Skip to content

Commit

Permalink
Use process.nextTick in Load step to improve latency at the cost of t…
Browse files Browse the repository at this point in the history
…hroughput
  • Loading branch information
benjie committed May 14, 2024
1 parent c4b735e commit f3d1426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grafast/grafast/src/steps/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,14 @@ export class LoadStep<
meta.loadBatchesByLoad.set(this.load, loadBatches);
// Guaranteed by the metaKey to be equivalent for all entries sharing the same `meta`. Note equivalent is not identical; key order may change.
const loadOptions = this.loadOptions!;
setTimeout(() => {
process.nextTick(() => {
// Don't allow adding anything else to the batch
meta.loadBatchesByLoad!.delete(this.load);
executeBatches(loadBatches!, this.load, {
...loadOptions,
unary: unary as TUnarySpec,
});
}, 0);
});
}
return (async () => {
const loadResults = await deferred;
Expand Down

0 comments on commit f3d1426

Please sign in to comment.