Created
January 22, 2016 20:49
-
-
Save leafo/6abb337bf52abcebf536 to your computer and use it in GitHub Desktop.
route benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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