Merge pull request #9405 from Snuffleupagus/pr-9245-followup
Re-factor resetting of `StatTimer` instances to fix completely broken benchmarking (PR 9245 follow-up)
This commit is contained in:
commit
628e70fbb5
@ -1056,8 +1056,8 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
|||||||
}, this);
|
}, this);
|
||||||
this.objs.clear();
|
this.objs.clear();
|
||||||
this.annotationsPromise = null;
|
this.annotationsPromise = null;
|
||||||
if (resetStats) {
|
if (resetStats && this._stats instanceof StatTimer) {
|
||||||
this._stats.reset();
|
this._stats = new StatTimer();
|
||||||
}
|
}
|
||||||
this.pendingCleanup = false;
|
this.pendingCleanup = false;
|
||||||
},
|
},
|
||||||
|
@ -411,10 +411,6 @@ function isExternalLinkTargetSet() {
|
|||||||
class StatTimer {
|
class StatTimer {
|
||||||
constructor(enable = true) {
|
constructor(enable = true) {
|
||||||
this.enabled = !!enable;
|
this.enabled = !!enable;
|
||||||
this.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
reset() {
|
|
||||||
this.started = Object.create(null);
|
this.started = Object.create(null);
|
||||||
this.times = [];
|
this.times = [];
|
||||||
}
|
}
|
||||||
@ -477,8 +473,6 @@ class DummyStatTimer {
|
|||||||
unreachable('Cannot initialize DummyStatTimer.');
|
unreachable('Cannot initialize DummyStatTimer.');
|
||||||
}
|
}
|
||||||
|
|
||||||
static reset() {}
|
|
||||||
|
|
||||||
static time(name) {}
|
static time(name) {}
|
||||||
|
|
||||||
static timeEnd(name) {}
|
static timeEnd(name) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user