Closed malaire closed 3 years ago
Interesting. I have tailored the code to be fast for the most common case, which is having routes with parameters and multisegments. The last time i ran the benchmarks in the crate, i added them to the README file. On linux and windows, its 50/50 between gonzales and matchit. On mac, i win hands down. I could further optimize for this specific case but i don't think its important. To me, the average performance is what matters.
ok, this is probably rarer use case for a router. Data in the test is actual data from URLs, but normally you'd match it as parameter and then e.g. fetch corresponding ID from database. I'm interested in knowing how well a router can match this directly.
I added
gonzales
to my literals-only benchmark (i.e. no params) and it's much slower thanmatchit
(or my work-in-progressmatcher
):Each iteration makes 20/200/2000 matches against 18/180/1800 routes, full code is here.
ps. I'm mentioning this because README says that "gonzales is the fastest http router in the business" but that is not the case here.