Skip to content
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

DeleteSet: optimize GC squash for improved performance #511

Conversation

MarkJGx
Copy link
Contributor

@MarkJGx MarkJGx commented Nov 7, 2024

This change set introduces an optimization to Yrs garbage collection squashing.

Details

To further enhance the scalability of the garbage collection (GC) process in DeleteSet, we've introduced a bulk squashing method that optimizes performance when handling large quantities of GC block cells. The previous per-block handling of squash calls worked well for many use cases. By implementing bulk squashing, we aim to reduce the overhead from constant reallocations while removing individual BlockCells (both GC and Block types).

Results

In our internal benchmark focusing on contiguous removals, we observed that the delete operation GC collection time decreased from 118 seconds to 400 milliseconds in release builds, representing a substantial performance improvement. (Please note, the benchmark uses proprietary types and cannot be shared publicly at this time.)

- Significantly improves performance during GC by batching squashes.
- Internal benchmarks with ~34,000 GC block cells reduced runtime from 118s to 400ms (~300x speedup) in release builds.
@MarkJGx MarkJGx changed the title DeleteSet: optimize bulk squash for improved performance DeleteSet: optimize GC squash for improved performance Nov 7, 2024
@Horusiath
Copy link
Collaborator

Thanks @MarkJGx . That sounds fantastic :) I'll review (and hopefully merge) it over the weekend.

@Horusiath Horusiath merged commit 74fb86e into y-crdt:main Nov 9, 2024
8 checks passed
@MarkJGx MarkJGx deleted the markjg/cloud/gc/optimization-refined branch November 9, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants