You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 "inverts" the logic of the `getLinkedOps` function. Rather
than building up an array from scratch, instead we create a shallow copy
of the `ops` array using `slice`, and remove any operations we don't
want using `splice`.
The anecdotal operation time using this modified function is now ~2s,
which is an improvement of an order of magnitude. The performance when
fetching a small number of operations is similar.
0 commit comments