As part of the work in precache logs for speed with cat-file --buffer, key lookups are now done twice as fast as before.

But, limits that look up keys still do a key lookup, before the key is looked up efficiently. Avoiding that would speed up --in etc, probably another 1.5x-2x speedup when such limits are used. What that optimisation needs is a way to tell if the current limit needs the key or not. If it does, then match on it after getting the key (and precaching the location log for limits that need that), otherwise before getting the key.

So this needs a way to introspect a limit to see if the terms used in it match some criteria. Another todo that also needs that is sync fast import --Joey

done --Joey