Uses 1113K of libraries. Click here for Pure Java version (2839L/14K).
1 | !7 |
2 | |
3 | cprint {
|
4 | switchable int count = 1000000; |
5 | |
6 | start-thread {
|
7 | long n = 0; |
8 | O o = null; |
9 | twice {
|
10 | time {
|
11 | repeat count {
|
12 | o = new Var(o); |
13 | n = advancedThreadMXBean().getThreadAllocatedBytes(threadID()); |
14 | } |
15 | } |
16 | print(n); |
17 | } |
18 | printMiniBenchResult("getThreadAllocatedBytes + making an object", count);
|
19 | } |
20 | } |
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: | 479 / 737 |
| Version history: | 8 change(s) |
| Referenced in: | [show references] |