Last active
January 22, 2016 22:15
-
-
Save saml/517fbd3ef83635c763b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var REGEX = /^((a)+)+$/; | |
function test(n) { | |
var input = Array(n).join('a') + 'b'; | |
var id = 'n='+n; | |
console.log(input); | |
console.time(id); | |
REGEX.exec(input); | |
console.timeEnd(id); | |
} | |
for (var i = 1; i < 60; i++) { | |
test(i); | |
} |
Author
saml
commented
Jan 6, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment