For backwards compatibility: use addOp amount instead of queue size.
This commit is contained in:
parent
877c2d7743
commit
5fa56f6a9d
@ -567,6 +567,7 @@ var OperatorList = (function OperatorListClosure() {
|
|||||||
this._totalLength = 0;
|
this._totalLength = 0;
|
||||||
this.pageIndex = pageIndex;
|
this.pageIndex = pageIndex;
|
||||||
this.intent = intent;
|
this.intent = intent;
|
||||||
|
this.weight = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
OperatorList.prototype = {
|
OperatorList.prototype = {
|
||||||
@ -584,10 +585,11 @@ var OperatorList = (function OperatorListClosure() {
|
|||||||
|
|
||||||
addOp(fn, args) {
|
addOp(fn, args) {
|
||||||
this.optimizer.push(fn, args);
|
this.optimizer.push(fn, args);
|
||||||
|
this.weight++;
|
||||||
if (this.messageHandler) {
|
if (this.messageHandler) {
|
||||||
if (this.fnArray.length >= CHUNK_SIZE) {
|
if (this.weight >= CHUNK_SIZE) {
|
||||||
this.flush();
|
this.flush();
|
||||||
} else if (this.fnArray.length >= CHUNK_SIZE_ABOUT &&
|
} else if (this.weight >= CHUNK_SIZE_ABOUT &&
|
||||||
(fn === OPS.restore || fn === OPS.endText)) {
|
(fn === OPS.restore || fn === OPS.endText)) {
|
||||||
// heuristic to flush on boundary of restore or endText
|
// heuristic to flush on boundary of restore or endText
|
||||||
this.flush();
|
this.flush();
|
||||||
@ -643,6 +645,7 @@ var OperatorList = (function OperatorListClosure() {
|
|||||||
this.dependencies = Object.create(null);
|
this.dependencies = Object.create(null);
|
||||||
this.fnArray.length = 0;
|
this.fnArray.length = 0;
|
||||||
this.argsArray.length = 0;
|
this.argsArray.length = 0;
|
||||||
|
this.weight = 0;
|
||||||
this.optimizer.reset();
|
this.optimizer.reset();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user