mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Use nano.jar in perf/index.html.
Former-commit-id: a5a3d79dd2c940dd654d2c91cf80665d72b22080
This commit is contained in:
@@ -20,12 +20,20 @@
|
||||
<script src="../vendor/benchmark.js/benchmark.js"></script>
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
|
||||
// using innerHTML avoids an alert in some versions of IE6
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<applet code=nano archive="../vendor/benchmark.js/nano.jar">';
|
||||
document.body.insertBefore(div.lastChild, document.body.firstChild);
|
||||
}
|
||||
}());
|
||||
|
||||
window.onload = function() {
|
||||
var sibling = document.scripts[0],
|
||||
script = document.createElement('script');
|
||||
|
||||
document.getElementById('FirebugUI').style.height = '100%';
|
||||
|
||||
script.src = 'perf.js';
|
||||
sibling.parentNode.insertBefore(script, sibling);
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
console.log('\n' + this.name + ':');
|
||||
},
|
||||
'onCycle': function(event) {
|
||||
console.log(event.target.toString());
|
||||
console.log(event.target + '');
|
||||
},
|
||||
'onComplete': function() {
|
||||
var fastest = this.filter('fastest').pluck('name'),
|
||||
@@ -93,9 +93,9 @@
|
||||
else {
|
||||
// report results
|
||||
if (score.lodash >= score.underscore) {
|
||||
console.log('\nLo-Dash is ' + (score.lodash / score.underscore).toFixed(2) + 'x faster than Underscore.\n');
|
||||
console.log('\nLo-Dash is ' + (score.lodash / score.underscore).toFixed(2) + 'x faster than Underscore.');
|
||||
} else {
|
||||
console.log('\nUnderscore is ' + (score.underscore / score.lodash).toFixed(2) + 'x faster than Lo-Dash.\n');
|
||||
console.log('\nUnderscore is ' + (score.underscore / score.lodash).toFixed(2) + 'x faster than Lo-Dash.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,6 +191,9 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
if (Benchmark.platform + '') {
|
||||
console.log(Benchmark.platform + '\n');
|
||||
}
|
||||
// start suites
|
||||
suites[0].run();
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
cd "$(dirname "$0")"
|
||||
for cmd in rhino ringo narwhal node; do
|
||||
echo ""
|
||||
echo "Running performance suite in $cmd..."
|
||||
$cmd perf.js
|
||||
done
|
||||
echo "\nRunning performance suite in a browser..."
|
||||
echo ""
|
||||
echo "Running performance suite in a browser..."
|
||||
open index.html
|
||||
@@ -1,7 +1,9 @@
|
||||
cd "$(dirname "$0")"
|
||||
for cmd in rhino ringo narwhal node; do
|
||||
echo ""
|
||||
echo "Testing in $cmd..."
|
||||
$cmd test.js
|
||||
done
|
||||
echo ""
|
||||
echo "Testing in a browser..."
|
||||
open index.html
|
||||
Reference in New Issue
Block a user