Heuristic to optimize chunking
This commit is contained in:
parent
257898b359
commit
1aaeec8020
@ -1278,6 +1278,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
|
|
||||||
var OperatorList = (function OperatorListClosure() {
|
var OperatorList = (function OperatorListClosure() {
|
||||||
var CHUNK_SIZE = 1000;
|
var CHUNK_SIZE = 1000;
|
||||||
|
var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; // close to chunk size
|
||||||
|
|
||||||
function getTransfers(queue) {
|
function getTransfers(queue) {
|
||||||
var transfers = [];
|
var transfers = [];
|
||||||
@ -1326,6 +1327,10 @@ var OperatorList = (function OperatorListClosure() {
|
|||||||
this.argsArray.push(args);
|
this.argsArray.push(args);
|
||||||
if (this.fnIndex >= CHUNK_SIZE) {
|
if (this.fnIndex >= CHUNK_SIZE) {
|
||||||
this.flush();
|
this.flush();
|
||||||
|
} else if (this.fnIndex >= CHUNK_SIZE_ABOUT &&
|
||||||
|
(fn === OPS.restore || fn === OPS.endText)) {
|
||||||
|
// heuristic to flush on boundary of restore or endText
|
||||||
|
this.flush();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.fnArray.push(fn);
|
this.fnArray.push(fn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user