Commit 5e8bd02
[dart2wasm] Make json parser use cache of boxed integers <=255
Many json files may have small integer numbers in them. Both dart2js and
VM don't need to actually box those small numbers as they have small
tagged integer support. Though dart2wasm boxes all integers when they
flow into top types.
=> We can use a cache of boxed integer numbers <= 255.
It does seem to overall improve json decoding benchmarks and
will reduce memory usage / pressure on the GC.
Change-Id: I026831e0f0841ae84a66652c0cc0e4689a4ab75e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410000
Commit-Queue: Martin Kustermann <[email protected]>
Reviewed-by: Ömer Ağacan <[email protected]>1 parent 6273c19 commit 5e8bd02
File tree
2 files changed
+60
-6
lines changed- pkg/dart2wasm/lib
- sdk/lib/_internal/wasm/lib
2 files changed
+60
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
304 | 310 | | |
305 | 311 | | |
306 | 312 | | |
| |||
689 | 695 | | |
690 | 696 | | |
691 | 697 | | |
692 | | - | |
| 698 | + | |
693 | 699 | | |
694 | 700 | | |
695 | 701 | | |
| |||
741 | 747 | | |
742 | 748 | | |
743 | 749 | | |
744 | | - | |
| 750 | + | |
| 751 | + | |
745 | 752 | | |
746 | 753 | | |
747 | 754 | | |
| |||
816 | 823 | | |
817 | 824 | | |
818 | 825 | | |
819 | | - | |
820 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
821 | 830 | | |
822 | 831 | | |
823 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
1433 | 1443 | | |
1434 | 1444 | | |
1435 | 1445 | | |
1436 | | - | |
| 1446 | + | |
1437 | 1447 | | |
1438 | 1448 | | |
1439 | 1449 | | |
| |||
1578 | 1588 | | |
1579 | 1589 | | |
1580 | 1590 | | |
1581 | | - | |
| 1591 | + | |
1582 | 1592 | | |
1583 | 1593 | | |
1584 | 1594 | | |
| |||
2795 | 2805 | | |
2796 | 2806 | | |
2797 | 2807 | | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
0 commit comments