Make perf-ui.js and test-ui.js more aligned, remove unzip perf test, and handle comparing to files of the same name in perf.js.

Former-commit-id: 7a5353aab76d6667b6dd5d43e85f95695e5a9cba
This commit is contained in:
John-David Dalton
2013-07-13 16:39:18 -07:00
parent 51e2f8e49b
commit 6d65cb77ec
3 changed files with 11 additions and 23 deletions

View File

@@ -24,7 +24,7 @@
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addEvent(element, eventName, handler) {
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
@@ -77,7 +77,7 @@
}());
// initialize controls
addEvent(window, 'load', function() {
addListener(window, 'load', function() {
function eventHandler(event) {
var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
if (event.stopPropagation) {

View File

@@ -76,7 +76,10 @@
var buildName = window.buildName = basename(ui.buildPath, '.js');
/** The other library basename */
var otherName = window.otherName = basename(ui.otherPath, '.js');
var otherName = window.otherName = (function() {
var result = basename(ui.otherPath, '.js');
return result + (result == buildName ? ' (2)' : '');
}());
/** Detect if in a browser environment */
var isBrowser = isHostType(window, 'document') && isHostType(window, 'navigator');
@@ -527,8 +530,7 @@
whereObject = { "num": 9 };\
}\
if (typeof zip != "undefined") {\
var unzipped = [["a", "b", "c"], [1, 2, 3], [true, false, true]],\
zipped = [["a", 1, true], ["b", 2, false], ["c", 3, true]];\
var unzipped = [["a", "b", "c"], [1, 2, 3], [true, false, true]];\
}'
});
@@ -1828,20 +1830,6 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.unzip`')
.add(buildName, {
'fn': 'lodash.unzip(zipped)',
'teardown': 'function zip(){}'
})
.add(otherName, {
'fn': '_.unzip(zipped)',
'teardown': 'function zip(){}'
})
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.values`')
.add(buildName, '\