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

15
LINES

< > BotCompany Repo | #1034268 // bench_getMethodCacheForClass

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5765L/32K).

// I'm getting 25 mill/s cache lookups which is not that great
svoid bench_getMethodCacheForClass() {
  print("Loading 1000 classes");
  L<Class> classes = map classForName(takeFirst(1000, classNamesInJigsawModule("java.base")));
  print("Have " + nClasses(classes) + ". Filling method caches");
  time {
    for (c : classes) assertNotNull(callOpt_getCache(c));
  }
  print("Looking them up again.");
  benchFor5(-> {
    for (c : classes) assertNotNull(callOpt_getCache(c));
  });

  print("Classes in method cache: " + l(callOpt_cache));
}

Author comment

Began life as a copy of #1034267

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034268
Snippet name: bench_getMethodCacheForClass
Eternal ID of this version: #1034268/12
Text MD5: b96257d3feb801229210ea7445df2b86
Transpilation MD5: 2e146a24e0ba8f2de02eee2c18117e67
Author: stefan
Category: javax / performance
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 15:47:09
Source code size: 556 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 166 / 289
Version history: 11 change(s)
Referenced in: [show references]