...Eight seconds for a hundred matches? What does your code look like?
Average time for 100 tests is hence 0.8 ms. Completely normal, and absolutely acceptable, especially for an operation as rare as routing.
Letting my previous comment as-is for historical purposes. And to remind myself I'm a dumbass.
Actually that’d be a fun sci-fi book.