/* * Copyright (C) 2016-2017 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ "use strict";
let statses = []; for (let [benchmark, results] of this._benchmarks) { for (let subResult of Results.subResults) {
statses.push(results[subResult]);
let val = results[subResult].valueForIteration(results[subResult].numIterations - 1); if (val > 0 && benchmark.name == this._benchmark.name) { this._values.push(val); this._names.push(benchmark.name + "_" + subResult);
}
}
}
let numIterations = Math.min(...statses.map(stats => stats.numIterations));
let data = new Array(numIterations); for (let i = 0; i < data.length; ++i)
data[i] = new Geomean();
for (let stats of statses) { for (let i = 0; i < data.length; ++i)
data[i].add(stats.valueForIteration(i));
}
let geomeans = data.map(geomean => geomean.result); if (geomeans.length == this._startIterations) { for (let iter = 0; iter < geomeans.length; iter++) { this._values.push(geomeans[iter]); this._names.push("geomean");
}
} this._summary.reset(...geomeans);
}
_iterate()
{ this._benchmark = this._iterator ? this._iterator.next().value : null; if (!this._benchmark) { if (!this._numIterations) { if (isInBrowser) { this._statusCell.innerHTML = "Restart"; this.readyTrigger(); if (typeof tpRecordTime !== "undefined")
tpRecordTime(this._values.join(','), 0, this._names.join(','));
this.sendResultsToRaptor();
} else
print("Success! Benchmark is now finished."); return;
} this._numIterations--; this._updateIterations(); this._iterator = this._benchmarks.keys(); this._benchmark = this._iterator.next().value;
}
sendResultsToRaptor()
{ // this contains all test names = [ "Air_firstIteration", "Air_averageWorstCase", ...] var allNames = this._names; // this contains all test metrics = [ 111, 83.5, 21.78894472361809, ...] var allValues = this._values; // this object will store name:[value1, value2, ...] pairs for the arrays above var measuredValuesByFullName = {}; for (var i = 0, len = allNames.length; i < len; i++) { if (measuredValuesByFullName[allNames[i]] === undefined) {
measuredValuesByFullName[allNames[i]] = [];
}
}
allNames.map(function(name, index) { // now we save all the values for each test // ex.: measuredValuesByFullName['Air_firstIteration'].push(111); // measuredValuesByFullName['Air_firstIteration'].push(107);
measuredValuesByFullName[name].push(allValues[index]);
});
// delete the geomean array - this will be calculated by raptor delete measuredValuesByFullName.geomean;
if (location.search === '?raptor') { var _data = ['raptor-benchmark', 'ares6', measuredValuesByFullName];
console.log('ares6 source is about to post results to the raptor webext');
window.postMessage(_data, '*');
window.sessionStorage.setItem('benchmark_results', JSON.stringify(_data));
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-04-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.