mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Remove java scaffolding from benchmarks.
This commit is contained in:
@@ -9,10 +9,6 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
applet {
|
|
||||||
position: absolute;
|
|
||||||
left: -9999em;
|
|
||||||
}
|
|
||||||
#FirebugUI {
|
#FirebugUI {
|
||||||
top: 2em;
|
top: 2em;
|
||||||
}
|
}
|
||||||
@@ -66,15 +62,6 @@
|
|||||||
setTimeout(run, 15);
|
setTimeout(run, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
// is the applet permitted?
|
|
||||||
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
|
|
||||||
// is the applet really needed?
|
|
||||||
while (!(measured = new Date - begin)) {}
|
|
||||||
if (measured > 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
|
|
||||||
// load applet
|
|
||||||
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.onload = init;
|
window.onload = init;
|
||||||
}());
|
}());
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
33
perf/perf.js
33
perf/perf.js
@@ -88,13 +88,10 @@
|
|||||||
/** Detect if in a browser environment. */
|
/** Detect if in a browser environment. */
|
||||||
var isBrowser = isHostType(root, 'document') && isHostType(root, 'navigator');
|
var isBrowser = isHostType(root, 'document') && isHostType(root, 'navigator');
|
||||||
|
|
||||||
/** Detect if in a Java environment. */
|
|
||||||
var isJava = !isBrowser && /Java/.test(toString.call(root.java));
|
|
||||||
|
|
||||||
/** Use a single "load" function. */
|
/** Use a single "load" function. */
|
||||||
var load = (typeof require == 'function' && !amd)
|
var load = (typeof require == 'function' && !amd)
|
||||||
? require
|
? require
|
||||||
: (isJava && root.load) || noop;
|
: noop;
|
||||||
|
|
||||||
/** Load lodash. */
|
/** Load lodash. */
|
||||||
var lodash = root.lodash || (root.lodash = (
|
var lodash = root.lodash || (root.lodash = (
|
||||||
@@ -205,7 +202,7 @@
|
|||||||
fbPanel.getElementById('fbPanel1');
|
fbPanel.getElementById('fbPanel1');
|
||||||
|
|
||||||
log('\nSit back and relax, this may take a while.');
|
log('\nSit back and relax, this may take a while.');
|
||||||
suites[0].run({ 'async': !isJava });
|
suites[0].run({ 'async': true });
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -258,7 +255,7 @@
|
|||||||
|
|
||||||
if (suites.length) {
|
if (suites.length) {
|
||||||
// Run next suite.
|
// Run next suite.
|
||||||
suites[0].run({ 'async': !isJava });
|
suites[0].run({ 'async': true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var aMeanHz = getGeometricMean(score.a),
|
var aMeanHz = getGeometricMean(score.a),
|
||||||
@@ -981,19 +978,17 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Avoid Underscore induced `OutOfMemoryError` in Rhino and Ringo.
|
// Avoid Underscore induced `OutOfMemoryError` in Rhino and Ringo.
|
||||||
if (!isJava) {
|
suites.push(
|
||||||
suites.push(
|
Benchmark.Suite('`_.find` with `_.matches` shorthand')
|
||||||
Benchmark.Suite('`_.find` with `_.matches` shorthand')
|
.add(buildName, {
|
||||||
.add(buildName, {
|
'fn': 'lodashFindWhere(objects, source)',
|
||||||
'fn': 'lodashFindWhere(objects, source)',
|
'teardown': 'function matches(){}'
|
||||||
'teardown': 'function matches(){}'
|
})
|
||||||
})
|
.add(otherName, {
|
||||||
.add(otherName, {
|
'fn': '_findWhere(objects, source)',
|
||||||
'fn': '_findWhere(objects, source)',
|
'teardown': 'function matches(){}'
|
||||||
'teardown': 'function matches(){}'
|
})
|
||||||
})
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user