Pux – High Performance Router for PHP
github.com
Pux – High Performance Router for PHP
1–10 of 58 posts
Re: Pux – High Performance Router for PHP
#2Re: Pux – High Performance Router for PHP
#3Re: Pux – High Performance Router for PHP
#4Re: Pux – High Performance Router for PHP
#5symfony/routing compiles routes only once to PHP code ([1]), and then that generated code is used for matching all subsequent requests. (There are multiple route matchers, but the default one works like this.)
It's amazing that Pux manages to be close to 50x times faster.
How is this achieved ?
[1] https://github.com/symfony/Routing/blob/0ee25e6580bd4169c128...
Re: Pux – High Performance Router for PHP
#6> Pux tries not to consume computation time to build all routes dynamically (like Symfony/Routing). Instead, Pux compiles your routes to plain PHP array for caching, the compiled routes can be loaded from cache very fast. symfony/routing compiles routes only once to PHP code ([1]), and then that generated code is used for matching all subsequent requests. (There are multiple route matchers, but the default one works…
And "compiled to php" is kinda meaningless, it depends what it's compiled to. There is no "native routing" language.
For my two cents, if you're having to translate your solution into simpler code your solution is wrong.
Re: Pux – High Performance Router for PHP
#7It's nice to see a PHP extension for routing to improve performance, but is it really necessary to compile the routing definition before being able to use it?
Re: Pux – High Performance Router for PHP
#8Re: Pux – High Performance Router for PHP
#9> Pux tries not to consume computation time to build all routes dynamically (like Symfony/Routing). Instead, Pux compiles your routes to plain PHP array for caching, the compiled routes can be loaded from cache very fast. symfony/routing compiles routes only once to PHP code ([1]), and then that generated code is used for matching all subsequent requests. (There are multiple route matchers, but the default one works…
Re: Pux – High Performance Router for PHP
#10Because routing is the bottleneck.