Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(fe): optimize keyword hash table
Improve the keyword hash table's hash function based on advice from youtube.com/@bunnyboss3707. This new hash function shrinks the table from 512 entries to 256 entries, reducing dcache pressure. The new hash function is also computationally simpler because it embeds the index modulo operation. Overall, the new hash table improves jQuery parse performance by about 0.9% on my Apple M1 machine: Benchmark Time CPU Time Old Time New CPU Old CPU New -------------------------------------------------------------------------------------------------------------------------- benchmark_parse_file_pvalue 0.0000 0.0000 U Test, Repetitions: 20 vs 20 benchmark_parse_file_mean -0.0094 -0.0094 1255343 1243571 1255046 1243307 benchmark_parse_file_median -0.0093 -0.0092 1254804 1243189 1254514 1243025 benchmark_parse_file_stddev -0.0571 -0.0800 3088 2912 2853 2625 benchmark_parse_file_cv -0.0481 -0.0713 0 0 0 0
- Loading branch information