Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor perf test changes.

  • Loading branch information...
commit 49a6d130e26f242241d5b6d8f81ecb7c0e596a26 1 parent bd5fc2b
Steven Levithan authored
Showing with 4 additions and 8 deletions.
  1. +3 −7 tests/perf/index.html
  2. +1 −1  tests/perf/perf.js
10 tests/perf/index.html
View
@@ -30,9 +30,8 @@
<script src="lib/benchmark.js"></script>
<script src="perf.js"></script>
-
<script>
- // Initialization code adapted from Lo-Dash <http://lodash.com/> performance tests...
+ // Benchmark initialization adapted from Lo-Dash <http://lodash.com/> performance tests...
(function() {
if (/[?&]nojava=true(?:&|$)/.test(location.search)) {
return;
@@ -45,14 +44,11 @@
// No-op
}
if (measured !== 1 && !(perf && typeof (perf.now || perf.webkitNow) === 'function')) {
- // Load the applet
+ // Load the Java applet for higher-precision timing
document.write('<applet code="nano" archive="lib/nano.jar"></applet>');
}
+ onload = run;
}());
- onload = function() {
- // Give the applet time to initialize
- setTimeout(run, 15);
- };
</script>
</body>
</html>
2  tests/perf/perf.js
View
@@ -136,7 +136,7 @@
var str = Array(30 + 1).join('hello xx world ');
suites.push(Benchmark.Suite('Iteration with nonglobal regex')
- .add('replace callback', function() {
+ .add('replace with callback', function() {
var r = /^|(((?=x).)\2)+/;
var matches = [];
if (!r.global) {
Please sign in to comment.
Something went wrong with that request. Please try again.