Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1005586 // Benchmark getDeclaredFields + getDeclaredFields_cached

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (629L/5K/16K).

!752

sclass A {
  int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8;
}

sclass B {
  int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8;
  int i = 9, j = 10, k = 11, l = 12, m = 13, n = 14;
}

static final long rep = 1000000;

p {
  twice {
    for (Class c : ll(A, B)) {
      time {
        for (long j = 0; j < rep; j++)
          c.getDeclaredFields();
      }
      print(iterationsPerSecond(rep) + " getDeclaredFields/s");
      
      time {
        for (long j = 0; j < rep; j++)
          getDeclaredFields_cached(c);
      }
      print(iterationsPerSecond(rep) + " getDeclaredFields_cached/s");
    }
  }
}

Author comment

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: 442 / 526
Referenced in: [show references]