New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Router to handler routes internally in a tree in order to reduce the regex evaluations and improve performance #678

Open
pmlopes opened this Issue Aug 9, 2017 · 9 comments

Comments

3 participants
@pmlopes
Copy link
Member

pmlopes commented Aug 9, 2017

This is a project that @slinkydeveloper would like to research

@pmlopes pmlopes added the quick win label Aug 9, 2017

@slinkydeveloper

This comment has been minimized.

Copy link
Member

slinkydeveloper commented Aug 9, 2017

I'm going to do some investigation and I'll write a blog post with it

@vietj

This comment has been minimized.

Copy link
Contributor

vietj commented Aug 9, 2017

so the tree would be a bit like a Trie ?

@vietj

This comment has been minimized.

Copy link
Contributor

vietj commented Aug 9, 2017

one thing you could also investigate for performance is regex Matcher reuse with Matcher#reset() method

@slinkydeveloper

This comment has been minimized.

Copy link
Member

slinkydeveloper commented Aug 9, 2017

@vietj as Paulo recommended to me, it will be a ctrie like, but with some changes to workaround common problems like a path with param and another path without param (/some/path and /some/:parameter) or other things.
Thank you for interesting, I will also check performance of Matcher with reset()

@pmlopes

This comment has been minimized.

Copy link
Member Author

pmlopes commented Aug 9, 2017

For reference a poc of a ctrie router that requires no regular expressions:

https://github.com/pmlopes/yoke/tree/experiments/small-yoke/framework/src/main/java/xyz/jetdrone/yoke/impl/tree

@vietj

This comment has been minimized.

Copy link
Contributor

vietj commented Aug 9, 2017

@pmlopes it does not seem concurrent though

@pmlopes

This comment has been minimized.

Copy link
Member Author

pmlopes commented Aug 10, 2017

@vietj it is a pure experiment it is not complete

@slinkydeveloper

This comment has been minimized.

Copy link
Member

slinkydeveloper commented Sep 25, 2017

@slinkydeveloper

This comment has been minimized.

Copy link
Member

slinkydeveloper commented Oct 17, 2017

I'm working on it. I have a question: I have to organize the routing process code all inside a new package (for example io.vertx.ext.web.router)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment