Add esprima and uglifyjs to compare against
This commit is contained in:
parent
61906485a1
commit
a1d9587519
@ -3,16 +3,20 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Acorn benchmark</title>
|
<title>Acorn benchmark</title>
|
||||||
<script src="../acorn.js"></script>
|
<script src="../acorn.js"></script>
|
||||||
|
<script src="compare/esprima.js"></script>
|
||||||
|
<script src="compare/uglifyjs.js"></script>
|
||||||
<script src="jquery-string.js"></script>
|
<script src="jquery-string.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<button onclick="test()">GO</button>
|
<button onclick="test('acorn')">Acorn</button>
|
||||||
|
<button onclick="test('esprima')">Esprima</button>
|
||||||
|
<button onclick="test('uglifyjs')">UglifyJS</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function test() {
|
function test(which) {
|
||||||
for (var i =0, t0 = +new Date; i < 10; ++i) acorn.parse(jquery164);
|
var lib = window[which];
|
||||||
var n = (+new Date - t0) + "ms";
|
for (var i =0, t0 = +new Date; i < 10; ++i) lib.parse(jquery164);
|
||||||
console.log(n);
|
document.body.appendChild(document.createElement("pre")).innerHTML =
|
||||||
document.body.appendChild(document.createElement("pre")).innerHTML = n;
|
which + ": " + (+new Date - t0) + "ms";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
3808
test/compare/esprima.js
Normal file
3808
test/compare/esprima.js
Normal file
File diff suppressed because one or more lines are too long
1372
test/compare/uglifyjs.js
Normal file
1372
test/compare/uglifyjs.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user