Quite a lot of progress on uExpress today. Added a lot of Request APIs, and then spent the night trying to optimize routing.

If path is simple (just a string), it’s possible to precalculate the path request would go through. This is what I did initially, and it raised speed from 20k/sec to 27k/sec at 1000 routes. But then I realized, I can then create actual uWS routes when route is simple and just use that precalculated path. And that significantly increased speed. It’s now 61.66k with 1000 routes and 90k/sec with 1 route. And 1000 routes + 1000 middlewares is now 26k/sec instead of 3k/sec. Great progress so far. Tomorrow I’ll have to also make it work with routers too, as right now it only optimizes paths for top application only.

image.png