Libraryless. Click here for Pure Java version (5672L/36K/130K).
1 | !7 |
2 | |
3 | sclass A { |
4 | int a; |
5 | |
6 | [stdEq] |
7 | } |
8 | |
9 | sclass B extends A { |
10 | int b; |
11 | |
12 | [stdEq] |
13 | } |
14 | |
15 | static int n = 500000; |
16 | |
17 | p { |
18 | final new L l; |
19 | for (int i = 0; i < n; i++) { |
20 | l.add(nu(A, a := 1)); |
21 | l.add(nu(B, a := 2, b := 3)); |
22 | } |
23 | print("Objects: " + l(l)); |
24 | structure_showTiming = true; |
25 | |
26 | fS struct = struct(l); |
27 | |
28 | L unstructd = cast unstructure(struct); // pre-run |
29 | assertEquals(l(l), l(unstructd)); // sanity check |
30 | |
31 | poorMansProfileToConsole(r { |
32 | L unstructd = cast unstructure(struct); |
33 | assertEquals(l(l), l(unstructd)); // sanity check |
34 | }); |
35 | } |
Began life as a copy of #1009440
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018547 |
Snippet name: | Profile unstructure with MANY custom objects containing primitive values |
Eternal ID of this version: | #1018547/4 |
Text MD5: | 2a971ff90a21c659112c6b300386c369 |
Transpilation MD5: | 4fd7b1664920978dea799c54d6440a04 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-05 13:23:20 |
Source code size: | 594 bytes / 35 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 423 / 517 |
Version history: | 3 change(s) |
Referenced in: | [show references] |