-
-
Save os0x/369663 to your computer and use it in GitHub Desktop.
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
// IEでも動くように(実質的には弄ったのはtest4のexecのみ) | |
var r = []; | |
var test = new Date*1; | |
for(var i=0;i<10000;i++){ | |
var src = "http://example.com/lab/test.js" | |
src.substring(0,src.lastIndexOf('/')+1) | |
} | |
r.push(new Date-test); | |
var test2 = new Date*1; | |
for(var i=0;i<10000;i++){ | |
var a='http://example.com/lab/test.js'.split("/"); a.pop(); | |
a.join("/") + "/"; | |
} | |
r.push(new Date-test2); | |
var test3 = new Date*1; | |
for(var i=0;i<10000;i++){ | |
"http://example.com/lab/test.js".split("/").slice(0,-1).join("/") + "/"; | |
} | |
r.push(new Date-test3); | |
var test4 = new Date*1; | |
for(var i=0;i<10000;i++){ | |
/^.+\//.exec('http://example.com/lab/test.js')[0]; | |
} | |
r.push(new Date-test4); | |
var test5 = new Date*1; | |
for(var i=0;i<10000;i++){ | |
"http://example.com/lab/test.js".replace(/[^\/]+$/,"") | |
} | |
r.push(new Date-test5); | |
alert(r.join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment