New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve asymptotics of merge-tree reconnect #11220
Improve asymptotics of merge-tree reconnect #11220
Conversation
…to partial-lengths-doc
…to partial-lengths-doc
⯅ @fluid-example/bundle-size-tests: +7.28 KB
Baseline commit: dca1cbe |
|
there is another place we do a similar costly walk: packages\dds\matrix\src\permutationvector.ts would be good to ensure we can support that case as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. added some comments that are mainly around maintainability here, but logic looks sound. please also get an issue filed for the matrix usage.
Filed AB#1577 for this. Looks not too bad. |
|
This commit is queued for merging with the |
Description
The previous implementation of
regeneratePendingOpnecessitated a linear walk over segments of the merge tree.This strategy can be improved by augmenting the
partialLengthsstructures stored at each block with information about unacked segments.However, that information isn't particularly cheap or straightforward to update: it could be done at the same asymptotic cost, but would likely add some undesirable constant factors to the partial lengths bookkeeping (which already needs to be updated on each insert/delete/structural change).
As a compromise, this adds the ability to optionally compute local partial length information to
PartialSequenceLengths, with the restriction that it's invalidated on update.This is sufficient for the reconnect flow, which regenerates all outstanding local ops upon reconnection without interleaving new ops.
Overall, for a merge tree with
Nsegments and some maximum collab window size, this reduces the cost of rebasingMlocal ops fromO(NM)toO(N + Mlog(N)).