Optimizing xreferee with elemIndex April 17, 2026
xreferee is a linter that checks that every
@(ref:foo) reference in a git repository corresponds to a #(ref:foo) anchor somewhere in the repository. It delegates most of the search to git grep, but there's some parsing logic to parse git grep's output. In a recent PR, I was able to get a 5x speedup with two changes: