darpi-rs / darpi

A rust web framework with safety and speed in mind.
https://darpi-rs.github.io/book/
33 stars 1 forks source link

improve routing performance #10

Closed petar-dambovaliev closed 3 years ago

petar-dambovaliev commented 3 years ago

At the moment, the code generated by the app is a match statement on the parsed incoming request path. That could be improved by making additional checks on the number of slashes in a path. It could be immediately discarded, if the application doesn't have a defined route with that amount. Routes can also be grouped in different match statements based on that number and thus potentially removing some comparisons that could lead to small performance gains.

Deserialization of path variables is also doing more work than it should.