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

20
LINES

< > BotCompany Repo | #1031409 // Thread-Local Memory Allocation Measurement Speed Test

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1113K of libraries. Click here for Pure Java version (2839L/14K).

!7

cprint {
  switchable int count = 1000000;
  
  start-thread {
    long n = 0;
    O o = null;
    twice {
      time {
        repeat count {
          o = new Var(o);
          n = advancedThreadMXBean().getThreadAllocatedBytes(threadID());
        }
      }
      print(n);
    }
    printMiniBenchResult("getThreadAllocatedBytes + making an object", count);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031409
Snippet name: Thread-Local Memory Allocation Measurement Speed Test
Eternal ID of this version: #1031409/9
Text MD5: 9d62044be8902bf07af07b41d30f668b
Transpilation MD5: 33cb28bf636a5e6aad2f6784cf6c8506
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-12 05:22:37
Source code size: 390 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 92 / 281
Version history: 8 change(s)
Referenced in: [show references]