Commit 38c385a
authored
Optimize lookup functions by caching array accesses (#296)
Reduced redundant array accesses in tableValue, lookupTable, and
lookupArray functions. Each iteration now caches the lookup result
in a local variable instead of accessing the same array element
twice (once for keyHash and once for key).
This reduces array subscript overhead in hot paths during table
and key lookups, particularly beneficial for documents with many
nested tables.1 parent 1dbaad6 commit 38c385a
1 file changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1840 | 1840 | | |
1841 | 1841 | | |
1842 | 1842 | | |
1843 | | - | |
| 1843 | + | |
| 1844 | + | |
1844 | 1845 | | |
1845 | 1846 | | |
1846 | 1847 | | |
1847 | 1848 | | |
1848 | 1849 | | |
1849 | | - | |
| 1850 | + | |
| 1851 | + | |
1850 | 1852 | | |
1851 | 1853 | | |
1852 | 1854 | | |
1853 | 1855 | | |
1854 | 1856 | | |
1855 | | - | |
| 1857 | + | |
| 1858 | + | |
1856 | 1859 | | |
1857 | 1860 | | |
1858 | 1861 | | |
| |||
1864 | 1867 | | |
1865 | 1868 | | |
1866 | 1869 | | |
1867 | | - | |
| 1870 | + | |
| 1871 | + | |
1868 | 1872 | | |
1869 | 1873 | | |
1870 | 1874 | | |
| |||
1875 | 1879 | | |
1876 | 1880 | | |
1877 | 1881 | | |
1878 | | - | |
| 1882 | + | |
| 1883 | + | |
1879 | 1884 | | |
1880 | 1885 | | |
1881 | 1886 | | |
| |||
0 commit comments