Libraryless. Click here for Pure Java version (5765L/32K).
1 | // I'm getting 25 mill/s cache lookups which is not that great |
2 | svoid bench_getMethodCacheForClass() { |
3 | print("Loading 1000 classes"); |
4 | L<Class> classes = map classForName(takeFirst(1000, classNamesInJigsawModule("java.base"))); |
5 | print("Have " + nClasses(classes) + ". Filling method caches"); |
6 | time { |
7 | for (c : classes) assertNotNull(callOpt_getCache(c)); |
8 | } |
9 | print("Looking them up again."); |
10 | benchFor5(-> { |
11 | for (c : classes) assertNotNull(callOpt_getCache(c)); |
12 | }); |
13 | |
14 | print("Classes in method cache: " + l(callOpt_cache)); |
15 | } |
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: | 225 / 368 |
Version history: | 11 change(s) |
Referenced in: | [show references] |