Repository navigation
Commit 0c22d07
authored
Allocate a value's copy closure only when the copy is deferred
Why:
`components_of_module_maker` built a closure for the copy of every
value it added, also when it then copied the value at once (the first
time the process builds a .cmi's components, and for every module
that is not part of a .cmi), and checked recorded counts against the
signature by converting the count array to a list.
`make_cell` now takes the substitution and the declaration and builds a
closure only for a deferred copy, and the counts are checked by walking
the signature with an index. Which values are deferred, the type ids
they take and the components built are unchanged.
Measured with scripts/compilerBenchmarks.js against the previous commit:
allocated words -0.15% in total, -0.25% in the project builds (where
components are built again in one process and their counts are known),
-0.04% for the files compiled one by one. On a 552 module React app
(clean build, one domain) the build allocates 0.2% fewer words.
Signed-off-by: Jono Prest <jjprest@gmail.com>1 parent 0de33b4 commit 0c22d07
1 file changed
Lines changed: 22 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1821 | 1821 | | |
1822 | 1822 | | |
1823 | 1823 | | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1824 | 1838 | | |
1825 | 1839 | | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
| 1840 | + | |
1838 | 1841 | | |
1839 | 1842 | | |
1840 | 1843 | | |
| |||
1846 | 1849 | | |
1847 | 1850 | | |
1848 | 1851 | | |
1849 | | - | |
| 1852 | + | |
| 1853 | + | |
1850 | 1854 | | |
1851 | 1855 | | |
1852 | 1856 | | |
1853 | 1857 | | |
1854 | 1858 | | |
1855 | 1859 | | |
1856 | | - | |
| 1860 | + | |
| 1861 | + | |
1857 | 1862 | | |
1858 | 1863 | | |
1859 | | - | |
| 1864 | + | |
1860 | 1865 | | |
1861 | 1866 | | |
1862 | 1867 | | |
1863 | | - | |
| 1868 | + | |
1864 | 1869 | | |
1865 | 1870 | | |
1866 | 1871 | | |
| |||
1870 | 1875 | | |
1871 | 1876 | | |
1872 | 1877 | | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
| 1878 | + | |
1876 | 1879 | | |
1877 | 1880 | | |
1878 | 1881 | | |
| |||
0 commit comments