frank icon indicating copy to clipboard operation
frank copied to clipboard

router performance observation

Open 404pnf opened this issue 9 years ago • 0 comments

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.

404pnf avatar Jul 28 '15 07:07 404pnf