mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Output built-in benchmark results regardless of consoleLogLevel
This commit is contained in:
parent
8f3d8cde7a
commit
a6355cecea
1 changed files with 4 additions and 4 deletions
|
@ -549,10 +549,10 @@ Matrix.prototype.fromSelfie = function(selfie) {
|
|||
Matrix.prototype.benchmark = async function() {
|
||||
const requests = await µBlock.loadBenchmarkDataset();
|
||||
if ( Array.isArray(requests) === false || requests.length === 0 ) {
|
||||
console.info('No requests found to benchmark');
|
||||
log.print('No requests found to benchmark');
|
||||
return;
|
||||
}
|
||||
console.info(`Benchmarking sessionFirewall.evaluateCellZY()...`);
|
||||
log.print(`Benchmarking sessionFirewall.evaluateCellZY()...`);
|
||||
const fctxt = µBlock.filteringContext.duplicate();
|
||||
const t0 = self.performance.now();
|
||||
for ( const request of requests ) {
|
||||
|
@ -567,8 +567,8 @@ Matrix.prototype.benchmark = async function() {
|
|||
}
|
||||
const t1 = self.performance.now();
|
||||
const dur = t1 - t0;
|
||||
console.info(`Evaluated ${requests.length} requests in ${dur.toFixed(0)} ms`);
|
||||
console.info(`\tAverage: ${(dur / requests.length).toFixed(3)} ms per request`);
|
||||
log.print(`Evaluated ${requests.length} requests in ${dur.toFixed(0)} ms`);
|
||||
log.print(`\tAverage: ${(dur / requests.length).toFixed(3)} ms per request`);
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
Loading…
Reference in a new issue