Commit 66f6533
Alec Gibson
Improve performance of
Running `getOps` to fetch a large number of operations is not very
performant.
Anecdotally, performing this operation on a local development machine
with a document comprising of ~200,000 operations takes ~20s.
The largest slow-down appears to come from the `getLinkedOps` method,
and in particular the use of `Array.unshift`.
This change makes a very simple change that `push`es to the array
instead of `unshift`, and then `reverse`s it at the end.
The anecdotal operation time using this modified function is now ~2s,
which is an improvement of an order of magnitude.getLinkedOps
1 parent 5a7c674 commit 66f6533
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | | - | |
| 540 | + | |
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
| |||
0 commit comments