Skip to content

Instantly share code, notes, and snippets.

@leafo
Created January 22, 2016 20:49
Show Gist options
  • Save leafo/6abb337bf52abcebf536 to your computer and use it in GitHub Desktop.
Save leafo/6abb337bf52abcebf536 to your computer and use it in GitHub Desktop.
route benchmark
socket = require "socket"
app = require "app"
app = app!
app.router\build!
paths = for route in *app.router.routes
route[1]\gsub ":%w+", "1"
start = socket.gettime!
for i=1,100
for path in *paths
assert app.router.p\match path
print socket.gettime! - start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment