Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #26169 [Routing] Handle very large set of dynamic routes (nicolas…
…-grekas) This PR was merged into the 4.1-dev branch. Discussion ---------- [Routing] Handle very large set of dynamic routes | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Follow up of #26059; allows handling very long lists of dynamic routes. Allows running https://github.com/tyler-sommer/php-router-benchmark seamlessly. BTW, here are the result of running this benchmark: R3 extension is not loaded. Skipping initialization for "Worst-case matching" test using R3. R3 extension is not loaded. Skipping initialization for "First route matching" test using R3. ## Worst-case matching This benchmark matches the last route and unknown route. It generates a randomly prefixed and suffixed route in an attempt to thwart any optimization. 1,000 routes each with 9 arguments. This benchmark consists of 10 tests. Each test is executed 1,000 times, the results pruned, and then averaged. Values that fall outside of 3 standard deviations of the mean are discarded. Test Name | Results | Time | + Interval | Change --------- | ------- | ---- | ---------- | ------ Symfony4 - unknown route (1000 routes) | 995 | 0.0000085699 | +0.0000000000 | baseline Symfony4 - last route (1000 routes) | 999 | 0.0000086754 | +0.0000001055 | 1% slower FastRoute - unknown route (1000 routes) | 980 | 0.0000305154 | +0.0000219455 | 256% slower FastRoute - last route (1000 routes) | 999 | 0.0000529922 | +0.0000444223 | 518% slower Pux PHP - unknown route (1000 routes) | 972 | 0.0003162730 | +0.0003077032 | 3591% slower Pux PHP - last route (1000 routes) | 999 | 0.0004376847 | +0.0004291148 | 5007% slower Aura v2 - unknown route (1000 routes) | 976 | 0.0138277517 | +0.0138191818 | 161253% slower Aura v2 - last route (1000 routes) | 989 | 0.0138914190 | +0.0138828491 | 161996% slower ## First route matching This benchmark tests how quickly each router can match the first route. 1,000 routes each with 9 arguments. This benchmark consists of 5 tests. Each test is executed 1,000 times, the results pruned, and then averaged. Values that fall outside of 3 standard deviations of the mean are discarded. Test Name | Results | Time | + Interval | Change --------- | ------- | ---- | ---------- | ------ FastRoute - first route | 999 | 0.0000016928 | +0.0000000000 | baseline Pux PHP - first route | 999 | 0.0000017381 | +0.0000000453 | 3% slower Symfony4 - first route | 997 | 0.0000029818 | +0.0000012890 | 76% slower Aura v2 - first route | 977 | 0.0000376436 | +0.0000359508 | 2124% slower Commits ------- ee8b201 [Routing] Handle very large set of dynamic routes
- Loading branch information