Commit 6cf6582
Empirical bench: substrate-routed typo lookup vs full closest_name scan
Adds `typo_bench_substrate_vs_full` as a cargo test (release build,
--nocapture for output). Measures lookup time at N = 10/100/1000/10000
symbol-table sizes, 1000 queries each.
Results validate the ~10x claim in docs/heal_pass.md:
| N | substrate_µs | full_µs | speedup |
|-------:|-------------:|---------:|--------:|
| 10 | 3.22 | 3.26 | 1.01× |
| 100 | 3.06 | 34.07 | 11.14× |
| 1000 | 32.64 | 352.64 | 10.80× |
| 10000 | 313.22 | 3365.22 | 10.74× |
Neutral (no overhead) at N=10 — bucketed hit rate is 0 because the
small table fits inside the fallback's working set.
Above N=100 the bucketed phase finds the match 100% without falling
back. Ratio holds flat across two orders of magnitude in N because
closest_name is linear in N while the substrate path stays bounded
by bucket size (~ N / 32 per probe, plus the prefer-set scan).
Updated docs/heal_pass.md with the empirical table.
Run: cargo test --release -p omnimcode-core typo_bench -- --nocapture
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 8469bae commit 6cf6582
2 files changed
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
31 | 44 | | |
32 | 45 | | |
33 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7854 | 7854 | | |
7855 | 7855 | | |
7856 | 7856 | | |
| 7857 | + | |
| 7858 | + | |
| 7859 | + | |
| 7860 | + | |
| 7861 | + | |
| 7862 | + | |
| 7863 | + | |
| 7864 | + | |
| 7865 | + | |
| 7866 | + | |
| 7867 | + | |
| 7868 | + | |
| 7869 | + | |
| 7870 | + | |
| 7871 | + | |
| 7872 | + | |
| 7873 | + | |
| 7874 | + | |
| 7875 | + | |
| 7876 | + | |
| 7877 | + | |
| 7878 | + | |
| 7879 | + | |
| 7880 | + | |
| 7881 | + | |
| 7882 | + | |
| 7883 | + | |
| 7884 | + | |
| 7885 | + | |
| 7886 | + | |
| 7887 | + | |
| 7888 | + | |
| 7889 | + | |
| 7890 | + | |
| 7891 | + | |
| 7892 | + | |
| 7893 | + | |
| 7894 | + | |
| 7895 | + | |
| 7896 | + | |
| 7897 | + | |
| 7898 | + | |
| 7899 | + | |
| 7900 | + | |
| 7901 | + | |
| 7902 | + | |
| 7903 | + | |
| 7904 | + | |
| 7905 | + | |
| 7906 | + | |
| 7907 | + | |
| 7908 | + | |
| 7909 | + | |
| 7910 | + | |
| 7911 | + | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
| 7919 | + | |
| 7920 | + | |
| 7921 | + | |
| 7922 | + | |
| 7923 | + | |
| 7924 | + | |
| 7925 | + | |
| 7926 | + | |
| 7927 | + | |
| 7928 | + | |
| 7929 | + | |
| 7930 | + | |
| 7931 | + | |
7857 | 7932 | | |
7858 | 7933 | | |
7859 | 7934 | | |
| |||
0 commit comments