mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Rename /benchmark to /perf.
Former-commit-id: 3688f3aeaf1e7d290d863cdba0d2277afcffa2e8
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
cd "$(dirname "$0")"
|
|
||||||
for cmd in rhino ringo narwhal node; do
|
|
||||||
echo "Benchmarking in $cmd..."
|
|
||||||
$cmd benchmark.js
|
|
||||||
done
|
|
||||||
echo "Benchmarking in a browser..."
|
|
||||||
open index.html
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Lo-Dash Benchmark Suite</title>
|
<title>Lo-Dash Performance Suite</title>
|
||||||
<style>
|
<style>
|
||||||
html, body {
|
html, body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
document.getElementById('FirebugUI').style.height = '100%';
|
document.getElementById('FirebugUI').style.height = '100%';
|
||||||
|
|
||||||
script.src = 'benchmark.js';
|
script.src = 'perf.js';
|
||||||
sibling.parentNode.insertBefore(script, sibling);
|
sibling.parentNode.insertBefore(script, sibling);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -88,9 +88,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.');
|
console.log('\nLo-Dash is ' + (score.lodash / score.underscore).toFixed(2) + 'x faster than Underscore.\n');
|
||||||
} else {
|
} else {
|
||||||
console.log('\nUnderscore is ' + (score.underscore / score.lodash).toFixed(2) + 'x faster than Lo-Dash.');
|
console.log('\nUnderscore is ' + (score.underscore / score.lodash).toFixed(2) + 'x faster than Lo-Dash.\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
7
perf/run-perf.sh
Executable file
7
perf/run-perf.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
cd "$(dirname "$0")"
|
||||||
|
for cmd in rhino ringo narwhal node; do
|
||||||
|
echo "Running performance suite in $cmd..."
|
||||||
|
$cmd perf.js
|
||||||
|
done
|
||||||
|
echo "\nRunning performance suite in a browser..."
|
||||||
|
open index.html
|
||||||
Reference in New Issue
Block a user