yjs icon indicating copy to clipboard operation
yjs copied to clipboard

optimize readAndApplyDeleteSet performance on large deletes

Open catssay opened this issue 8 months ago • 2 comments

When calling applyUpdate with large text and many deletes, frequent structs.splice calls become a performance bottleneck. To improve this, we replace the repeated splice operations by rebuilding the structs array from scratch — combining the existing and newly added structs — while preserving the same side effects as before.

catssay avatar Apr 22 '25 03:04 catssay

Can you please make sure that the tests run?

Also, do you have some numbers / test-cases that confirm that this improves performance? Does this decrease performance in some cases?

dmonad avatar Apr 22 '25 11:04 dmonad

Can you please make sure that the tests run?

Also, do you have some numbers / test-cases that confirm that this improves performance? Does this decrease performance in some cases?

Sure, I will make sure tests run and do some performance testing when I get some free time soon.

catssay avatar Apr 23 '25 06:04 catssay