This is a forward-port from the (8yr old) accelerate-lookups branch. The overhead is too high though, so going to abandon it. Posting for posterity.