Skip to content
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

router performance observation #4

Open
404pnf opened this issue Jul 28, 2015 · 0 comments
Open

router performance observation #4

404pnf opened this issue Jul 28, 2015 · 0 comments

Comments

@404pnf
Copy link

404pnf commented Jul 28, 2015

When number of routes increase, router performance drops linearly (still amazing, though : ).

Generate routes.

# ruby
s = (1..1000).to_a.map { |e| %Q(get "/#{e}" { "hello" } ) }.join("\n")
File.write('frank_router_performance.cr', s)

Run the app.

Test performace

 wrk -c100 -t 2 -d 10s http://127.0.0.1:3000/1
 wrk -c100 -t 2 -d 10s http://127.0.0.1:3000/100
 wrk -c100 -t 2 -d 10s http://127.0.0.1:3000/500
 wrk -c100 -t 2 -d 10s http://127.0.0.1:3000/1000

Linear drop of performance. Because of @routes = [] of Route ?

I don't think it's an issue in production, most app only have several routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant