An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
May 24, 2021 09:36 am GMT
Original Link: https://dev.to/alexdodonov/new-benchmark-mezon-router-is-up-to-222-times-faster-than-steampixel-router-4mdp
New benchmark: Mezon Router is up to 222 times faster than Steampixel Router
Hi all! Today we have one more benchmark.
As usual we have two cases:
- http server accepts request, launches php script, which handles this request, and then all script data is removed from memory. All following requests are processed in the same way. In this case very critical to launch script as soon as possible and we do not have time for long pre-compilations and preparations. Because all of it will be lost after the script will finish working;
- php script is launching, initiating all internal components (and router is one of them) and then starting processing requests. This case can be organized via for example react-php. It differs from the previous case because we can spend reasonable time to pre-compile routes for faster processing.
The first case
RouteGenerator::generateSteampixelStaticRoutes(1000);\Steampixel\Route::run('/static/0');RouteGenerator::generateSteampixelStaticRoutes(1000);\Steampixel\Route::run('/static/99');RouteGenerator::generateSteampixelStaticRoutes(1000);\Steampixel\Route::run('/static/199');// and so on up to /static/999 route
RouteGenerator::generateSteampixelNonStaticRoutes(1000);\Steampixel\Route::run('/param/0/1');RouteGenerator::generateSteampixelNonStaticRoutes(1000);\Steampixel\Route::run('/param/99/1');RouteGenerator::generateSteampixelNonStaticRoutes(1000);\Steampixel\Route::run('/param/199/1');// and so on up to /param/999/1 route
The second case
RouteGenerator::generateSteampixelNonStaticRoutes(1000);\Steampixel\Route::run('/static/0');\Steampixel\Route::run('/static/99');\Steampixel\Route::run('/static/199');// and so on up to /static/999 route
RouteGenerator::generateSteampixelNonStaticRoutes(1000);\Steampixel\Route::run('/param/0/1');\Steampixel\Route::run('/param/99/1');\Steampixel\Route::run('/param/199/1');// and so on up to /param/999/1 route
OK What do we have?
The first case + static routes
+------------------------------------+-------------+-----+------+-----+------------+---------------+---------------+---------------+---------------+-------------+--------+--------+| benchmark | subject | set | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff |+------------------------------------+-------------+-----+------+-----+------------+---------------+---------------+---------------+---------------+-------------+--------+--------+| CoffeeSingleRequestStaticBench | benchStatic | 0 | 10 | 10 | 2,721,192b | 41,307.500s | 45,096.590s | 42,128.908s | 61,295.100s | 6,320.995s | 14.02% | 4.85x || DVKSingleRequestStaticBench | benchStatic | 0 | 10 | 10 | 3,177,992b | 24,590.200s | 27,811.340s | 27,001.933s | 36,327.300s | 3,083.099s | 11.09% | 2.99x || HoaSingleRequestStaticBench | benchStatic | 0 | 10 | 10 | 3,780,328b | 43,449.100s | 43,772.210s | 43,661.100s | 44,222.900s | 235.195s | 0.54% | 4.71x || MezonSingleRequestStaticBench | benchStatic | 0 | 10 | 10 | 2,219,792b | 9,089.700s | 9,299.940s | 9,279.696s | 9,561.000s | 142.680s | 1.53% | 1.00x || PeceeSingleRequestStaticBench | benchStatic | 0 | 10 | 10 | 6,947,552b | 34,829.400s | 35,706.170s | 35,652.755s | 36,724.600s | 474.942s | 1.33% | 3.84x || SteampixelSingleRequestStaticBench | benchStatic | 0 | 10 | 10 | 2,498,808b | 194,219.800s | 196,558.930s | 196,331.508s | 200,720.300s | 1,645.088s | 0.84% | 21.14x |+------------------------------------+-------------+-----+------+-----+------------+---------------+---------------+---------------+---------------+-------------+--------+--------+
The first case + non-static routes
+---------------------------+------------+-----+------+-----+------------+--------------+--------------+--------------+--------------+-------------+--------+--------+| benchmark | subject | set | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff |+---------------------------+------------+-----+------+-----+------------+--------------+--------------+--------------+--------------+-------------+--------+--------+| CoffeeReactParamBench | benchParam | 0 | 10 | 10 | 2,194,328b | 7,760.800s | 8,367.330s | 7,971.543s | 10,153.900s | 778.770s | 9.31% | 7.57x || DVKReactParamBench | benchParam | 0 | 100 | 10 | 2,441,688b | 13,716.880s | 15,382.193s | 15,478.981s | 17,333.080s | 991.996s | 6.45% | 13.91x || HoaReactParamBench | benchParam | 0 | 100 | 10 | 3,294,616b | 3,582.400s | 4,080.933s | 4,197.178s | 4,528.640s | 325.111s | 7.97% | 3.69x || MezonReactParamBench | benchParam | 0 | 100 | 10 | 3,061,904b | 1,019.620s | 1,105.630s | 1,059.608s | 1,265.810s | 76.777s | 6.94% | 1.00x || PeceeReactParamBench | benchParam | 0 | 10 | 10 | 4,487,512b | 43,167.500s | 45,641.740s | 45,183.376s | 51,542.400s | 2,227.952s | 4.88% | 41.28x || SteampixelReactParamBench | benchParam | 0 | 10 | 10 | 2,256,032b | 17,826.400s | 18,485.750s | 18,245.010s | 20,641.000s | 777.997s | 4.21% | 16.72x |+---------------------------+------------+-----+------+-----+------------+--------------+--------------+--------------+--------------+-------------+--------+--------+
The second case + static routes
+----------------------------+-------------+-----+------+-----+------------+---------------+---------------+---------------+---------------+-------------+--------+------------+| benchmark | subject | set | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff |+----------------------------+-------------+-----+------+-----+------------+---------------+---------------+---------------+---------------+-------------+--------+------------+| CoffeeReactStaticBench | benchStatic | 0 | 10 | 10 | 2,194,360b | 7,992.400s | 8,278.480s | 8,161.593s | 9,130.000s | 317.905s | 3.84% | 416.02x || DVKReactStaticBench | benchStatic | 0 | 100 | 10 | 2,437,296b | 10,202.950s | 10,691.660s | 10,478.296s | 12,547.980s | 638.242s | 5.97% | 537.30x || HoaReactStaticBench | benchStatic | 0 | 100 | 10 | 2,826,400b | 3,585.590s | 3,725.367s | 3,616.349s | 4,167.740s | 189.042s | 5.07% | 187.21x || MezonReactStaticBench | benchStatic | 0 | 100 | 10 | 1,840,624b | 18.730s | 19.899s | 19.241s | 22.630s | 1.208s | 6.07% | 1.00x || PeceeReactStaticBench | benchStatic | 0 | 10 | 10 | 4,106,416b | 18,972.800s | 19,696.340s | 19,639.540s | 20,493.800s | 425.149s | 2.16% | 989.82x || SteampixelReactParamBench | benchStatic | 0 | 10 | 10 | 2,602,624b | 235,412.100s | 239,436.830s | 237,784.100s | 252,016.100s | 4,582.392s | 1.91% | 221.61x |+----------------------------+-------------+-----+------+-----+------------+---------------+---------------+---------------+---------------+-------------+--------+------------+
The second case + non-static routes
+-----------------------------------+------------+-----+------+-----+--------------+---------------+---------------+---------------+---------------+--------------+--------+-------+| benchmark | subject | set | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff |+-----------------------------------+------------+-----+------+-----+--------------+---------------+---------------+---------------+---------------+--------------+--------+-------+| CoffeeSingleRequestParamBench | benchParam | 0 | 10 | 10 | 3,688,232b | 51,588.400s | 52,322.470s | 52,054.399s | 53,208.300s | 535.329s | 1.02% | 1.77x || DVKSingleRequestParamBench | benchParam | 0 | 10 | 10 | 3,170,376b | 28,365.100s | 29,573.940s | 28,775.061s | 36,744.700s | 2,410.586s | 8.15% | 1.00x || HoaSingleRequestParamBench | benchParam | 0 | 10 | 10 | 4,099,256b | 45,535.800s | 46,021.020s | 45,784.508s | 46,996.600s | 432.767s | 0.94% | 1.56x || MezonSingleRequestParamBench | benchParam | 0 | 10 | 10 | 139,441,144b | 122,050.900s | 126,141.770s | 124,773.830s | 135,054.800s | 3,791.321s | 3.01% | 4.27x || PeceeSingleRequestParamBench | benchParam | 0 | 10 | 10 | 6,531,736b | 73,582.600s | 74,616.210s | 74,750.904s | 76,412.000s | 873.393s | 1.17% | 2.52x || SteampixelSingleRequestParamBench | benchParam | 0 | 10 | 10 | 2,598,760b | 219,314.600s | 232,375.440s | 226,123.319s | 268,318.200s | 14,198.405s | 6.11% | 7.86x |+-----------------------------------+------------+-----+------+-----+--------------+---------------+---------------+---------------+---------------+--------------+--------+-------+
What's next?
More articles can be found in my Twitter
What is mezon/router?
mezon/router now is:
- framework for routing with 100% code coverage
- 10.0 points on scrutinizer-ci.com
- router is a part of the Mezon Project
Repo on github.com: https://github.com/alexdodonov/mezon-router
It will be great if you will contribute something to this project. Documentation, sharing the project in your social media, bug fixing, refactoring, or even submitting issue with question or feature request. Thanks anyway )
Original Link: https://dev.to/alexdodonov/new-benchmark-mezon-router-is-up-to-222-times-faster-than-steampixel-router-4mdp
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To