micro-router icon indicating copy to clipboard operation
micro-router copied to clipboard

Fastify benchmark lists this package as a performance killer

Open brandonros opened this issue 7 years ago • 2 comments

https://github.com/fastify/fastify

Framework Version Router? Requests/sec
micro (microrouter) 9.1.0 ([email protected] ) 18,314
micro 9.1.0 31,793

Is this out of date or accurate? Can anything be done to make this package not be a performance killer?

brandonros avatar May 01 '18 19:05 brandonros

Also interested in this subject. My wild guess culprit could be url / url-pattern as it's relying on some [slow] regex.

ilionic avatar Jun 04 '18 18:06 ilionic

Tried https://github.com/petkaantonov/urlparser Some benchmarks:

With node url:

 Both are awesome but micro is 67.92% faster than microrouter
 • micro request average is 13524
 • microrouter request average is 8054
✨  Done in 4.86s.

With fast-url-parser:

 Both are awesome but micro is 51.92% faster than microrouter
 • micro request average is 14260
 • microrouter request average is 9386.4
✨  Done in 3.48s.

So there are some improvements as you can see. I can send PR ( using fastify benchmarks https://github.com/fastify/benchmarks )

Looks like should be possible to boost more performance refactoring url-pattern

ilionic avatar Jun 04 '18 19:06 ilionic