dimdenGD / ultimate-express

The Ultimate Express. Fastest http server with full Express compatibility, based on µWebSockets.
Apache License 2.0
519 stars 15 forks source link

Feature: Use find-my-way instead of express route #23

Closed cesco69 closed 1 month ago

cesco69 commented 1 month ago

find-my-way https://www.npmjs.com/package/find-my-way is the router of fastify!

this is an old wrapper for express https://github.com/moajs/moa-router

this is another express like server that implement find-my-way https://github.com/andrehrferreira/cmmv-server/blob/f7583f9b54f04a3338f36745456f491f54d7bfa3/packages/server/lib/router.ts#L4

This is a router benchmark https://github.com/delvedor/router-benchmark

=======================
 find-my-way benchmark
=======================
short static: 10,102,066 ops/sec
static with same radix: 3,887,679 ops/sec
dynamic route: 1,637,929 ops/sec
mixed static dynamic: 2,289,554 ops/sec
long static: 5,403,719 ops/sec
wildcard: 3,037,119 ops/sec
all together: 525,798 ops/sec

================================================
 express benchmark (WARNING: includes handling)
================================================
short static: 1,145,409 ops/sec
static with same radix: 1,102,656 ops/sec
dynamic route: 595,169 ops/sec
mixed static dynamic: 513,327 ops/sec
long static: 642,545 ops/sec
wildcard: 407,398 ops/sec
all together: 100,184 ops/sec
dimdenGD commented 1 month ago

Could be interesting but idk if it could work with route optimizer

dimdenGD commented 1 month ago

I checked the API and examples and I don't think it's possible to implement it while having full compatibility with Express

cesco69 commented 1 month ago

ok, thanks @dimdenGD