Skip to content

Speed up insertion and deletion of values in SortedList by batching and deferring to idle task#5038

Merged
Tyriar merged 11 commits intoxtermjs:masterfrom
Tyriar:tyriar/4911
Apr 20, 2024
Merged

Speed up insertion and deletion of values in SortedList by batching and deferring to idle task#5038
Tyriar merged 11 commits intoxtermjs:masterfrom
Tyriar:tyriar/4911

Conversation

@Tyriar
Copy link
Copy Markdown
Member

@Tyriar Tyriar commented Apr 20, 2024

Fixes #4911

Test setup:

  • 10000 scrollback filled
  • Decoration stress test button
  • ~10000 * 20 = ~200,000 decorations

Before:

Insert ~4s
Delete ~4s

image

After:

Insert ~330ms
Delete ~93ms

There's still a decent amount of GC happening on insert, but a lot of it has to happen due to the variables being used in callbacks. It's reasonable when you consider it's 200000 decorations.

image

@Tyriar Tyriar added this to the 5.6.0 milestone Apr 20, 2024
@Tyriar Tyriar self-assigned this Apr 20, 2024
@Tyriar Tyriar enabled auto-merge April 20, 2024 18:17
@Tyriar Tyriar merged commit 0d799ba into xtermjs:master Apr 20, 2024
@Tyriar Tyriar modified the milestones: 5.6.0, 6.0.0 Jul 14, 2024
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.

Mass decoration registration and disposable is slow

1 participant