Libraryless. Click here for Pure Java version (5382L/29K).
1 | // 6.5 mega exceptions per second (MEPS) |
2 | // So this is ~25 times faster as regular exceptions |
3 | svoid bench_throwAndCatchQuickException() {
|
4 | benchFor10(-> {
|
5 | try {
|
6 | if (alwaysTrue()) |
7 | throw new QuickException; |
8 | } catch (QuickException e) {
|
9 | } |
10 | }); |
11 | } |
Began life as a copy of #1034261
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1034262 |
| Snippet name: | bench_throwAndCatchQuickException - I get something like 6.5 million/second |
| Eternal ID of this version: | #1034262/3 |
| Text MD5: | 41f7729078f74228b85c884986d17e63 |
| Transpilation MD5: | 9eb1ce78ed96cdbce85d07108f06ecb4 |
| Author: | stefan |
| Category: | javax / gazelle v |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-01-29 13:22:41 |
| Source code size: | 280 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 405 / 498 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |