Skip to content

Conversation

@pissang
Copy link
Contributor

@pissang pissang commented Sep 24, 2021

Currently, we are using an O(ND) diff algorithm(Myers' Diff Algorithm) in the SVG renderer. But when we do first render or clear all things on canvas. The complex becomes O(N2) because the difference is the whole N. Which will cause a significant performance drop. Especially we can't avoid the first render. So in this PR, I did a simple optimization to handle these two cases. The time of the first frame render comes down to 100ms from the terrible 3000ms for 10k objects.

Also, I found an existing bug that appears after the change in #829 and fixed it.

@pissang pissang merged commit 99449dc into master Sep 24, 2021
@pissang pissang deleted the optimize-arraydiff branch September 24, 2021 06:29
@pissang pissang mentioned this pull request Oct 7, 2021
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.

3 participants