Libraryless. Click here for Pure Java version (629L/5K/16K).
1 | !752 |
2 | |
3 | sclass A { |
4 | int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8; |
5 | } |
6 | |
7 | sclass B { |
8 | int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8; |
9 | int i = 9, j = 10, k = 11, l = 12, m = 13, n = 14; |
10 | } |
11 | |
12 | static final long rep = 1000000; |
13 | |
14 | p { |
15 | twice { |
16 | for (Class c : ll(A, B)) { |
17 | time { |
18 | for (long j = 0; j < rep; j++) |
19 | c.getDeclaredFields(); |
20 | } |
21 | print(iterationsPerSecond(rep) + " getDeclaredFields/s"); |
22 | |
23 | time { |
24 | for (long j = 0; j < rep; j++) |
25 | getDeclaredFields_cached(c); |
26 | } |
27 | print(iterationsPerSecond(rep) + " getDeclaredFields_cached/s"); |
28 | } |
29 | } |
30 | } |
Began life as a copy of #1005581
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005586 |
Snippet name: | Benchmark getDeclaredFields + getDeclaredFields_cached |
Eternal ID of this version: | #1005586/1 |
Text MD5: | 490e2eeae9a36857eeb7cf48924282bf |
Transpilation MD5: | 4af06b74bd96957e9ea7387e1a46430c |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-11-28 19:18:21 |
Source code size: | 664 bytes / 30 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 530 / 638 |
Referenced in: | [show references] |