mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +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/benchmark.js/benchmark.js"></script>
|
||||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||||
<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() {
|
window.onload = function() {
|
||||||
var sibling = document.scripts[0],
|
var sibling = document.scripts[0],
|
||||||
script = document.createElement('script');
|
script = document.createElement('script');
|
||||||
|
|
||||||
document.getElementById('FirebugUI').style.height = '100%';
|
document.getElementById('FirebugUI').style.height = '100%';
|
||||||
|
|
||||||
script.src = 'perf.js';
|
script.src = 'perf.js';
|
||||||
sibling.parentNode.insertBefore(script, sibling);
|
sibling.parentNode.insertBefore(script, sibling);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
console.log('\n' + this.name + ':');
|
console.log('\n' + this.name + ':');
|
||||||
},
|
},
|
||||||
'onCycle': function(event) {
|
'onCycle': function(event) {
|
||||||
console.log(event.target.toString());
|
console.log(event.target + '');
|
||||||
},
|
},
|
||||||
'onComplete': function() {
|
'onComplete': function() {
|
||||||
var fastest = this.filter('fastest').pluck('name'),
|
var fastest = this.filter('fastest').pluck('name'),
|
||||||
@@ -93,9 +93,9 @@
|
|||||||
else {
|
else {
|
||||||
// report results
|
// report results
|
||||||
if (score.lodash >= score.underscore) {
|
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 {
|
} 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
|
// start suites
|
||||||
suites[0].run();
|
suites[0].run();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
for cmd in rhino ringo narwhal node; do
|
for cmd in rhino ringo narwhal node; do
|
||||||
|
echo ""
|
||||||
echo "Running performance suite in $cmd..."
|
echo "Running performance suite in $cmd..."
|
||||||
$cmd perf.js
|
$cmd perf.js
|
||||||
done
|
done
|
||||||
echo "\nRunning performance suite in a browser..."
|
echo ""
|
||||||
|
echo "Running performance suite in a browser..."
|
||||||
open index.html
|
open index.html
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
for cmd in rhino ringo narwhal node; do
|
for cmd in rhino ringo narwhal node; do
|
||||||
|
echo ""
|
||||||
echo "Testing in $cmd..."
|
echo "Testing in $cmd..."
|
||||||
$cmd test.js
|
$cmd test.js
|
||||||
done
|
done
|
||||||
|
echo ""
|
||||||
echo "Testing in a browser..."
|
echo "Testing in a browser..."
|
||||||
open index.html
|
open index.html
|
||||||
Reference in New Issue
Block a user