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
Slow apply when garbage collecting large update #541
Comments
hi, @NilSet This issue is not reproduce on the Yjs 13.6.5 via your repo . 2023-06-29.18.46.18.mov
|
You are on main branch, this issue links to the slow-gc branch which checks a different anonymized sample with different characteristics than the main branch. |
Hi, @NilSet I swithed the And this issue is not reproduce on the Yjs 14.0.0-1 2023-06-30.10.33.42.mov |
You are still on the wrong branch. |
I published a fix in 13.6.7. I will close this ticket when I/somebody confirms this is fixed. |
@NilSet I can run your reproduction repo now in 9 seconds (45 seconds using Yjs@v13.6.4). |
Checklist
Describe the bug Given a large, ungarbagecollected doc which was persisted as an encoded update, if you apply the update to a document with garbage collection enabled, the apply can take a very long time. Based on my profiling, the time is all in tryToMergeWithLeft, possibly due to calling
structs.splice(pos, 1)
many times, requiring the shifting of a very large array each time.To Reproduce A anonymized document which reproduces this problem can be found here: https://github.com/NilSet/yjs-stack-overflow/tree/slow-gc On my machine it takes 38 seconds to apply the document with garbage collection enabled. Note that if you change the test script to disable gc on the doc, it only takes 1.6 seconds to apply the document.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Environment Information
Huly®: YJS-373
The text was updated successfully, but these errors were encountered: