Transpiled version (6758L) is out of date.
1 | // adds entries in sorted order |
2 | svoid test_compareTreeSetSizes(int n default 1000) { |
3 | test_compareTreeSetSizes(uniquifyAndSort(repF(n, -> randomID(6)))); |
4 | } |
5 | |
6 | svoid test_compareTreeSetSizes(LS data) { |
7 | print("Entries: " + n2(data)); |
8 | long payloadSize = sumOfObjectSizes(data); |
9 | var sorted = sorted(data); |
10 | |
11 | L<Set<S>> sets = ll( |
12 | new TreeSet(data), |
13 | new CompactTreeSet(data), |
14 | new UltraCompactTreeSet(data), |
15 | new MegaCompactTreeSet(data), |
16 | new HyperCompactTreeSet(data)); |
17 | |
18 | for (set : sets) { |
19 | assertEquals(toList(set), sorted); |
20 | print(className(set) + " OK, bytes per entry: " + formatDoubleRatio(guessObjectSize(set)-payloadSize, l(data), 4)); |
21 | } |
22 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032624 |
Snippet name: | test_compareTreeSetSizes |
Eternal ID of this version: | #1032624/8 |
Text MD5: | 5f55daa3350b1f3455c9e856d6f29855 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-29 23:11:38 |
Source code size: | 706 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 137 / 212 |
Version history: | 7 change(s) |
Referenced in: | [show references] |