Libraryless. Click here for Pure Java version (4725L/27K).
1 | static <A> S renderCollectionBytesPerEntry(Cl<A> l) { |
2 | O[] a = toObjectArray_nonConcurrent(l); |
3 | long arraySize = unsafe_sizeOf(a); |
4 | long payloadSize = guessObjectSize(a)-arraySize; |
5 | |
6 | long fullSize = guessObjectSize(l); |
7 | |
8 | ret "A " + className(l) + " with " + nElements(l) + " uses " |
9 | + formatDoubleRatio(fullSize-payloadSize, l(a), 4) + " bytes per element (full size: " + n2(fullSize) + ", payload: " + n2(payloadSize) + ")"; |
10 | } |
Began life as a copy of #1032635
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032636 |
Snippet name: | renderCollectionBytesPerEntry |
Eternal ID of this version: | #1032636/1 |
Text MD5: | e927666bdc7af14110b91924f91ce0cf |
Transpilation MD5: | 20afd06029668364f904daa72c944e3b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-29 22:49:44 |
Source code size: | 448 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 147 / 195 |
Referenced in: | [show references] |