Optimize gc from decoration-related hot code paths#4080
Optimize gc from decoration-related hot code paths#4080Tyriar merged 3 commits intoxtermjs:masterfrom
Conversation
They're too low performance for typical use cases Fixes xtermjs#4079
|
@Tyriar Maybe related (and maybe already fixed?) - when doing some perf benchmarks with canvas renderer I found this to be quite expensive (up to 25% of the renderer runtime): I did not look at the code in detail, so I dont know what causes the high runtime for sure. I saw that there are some iterators/generators, maybe those are already the culprit? (They were a real showstopper in the past, but I think engines got alot better in handling those in a speedy manner). Since I had no decorations in place at all I wonder if there is at least an early fast exit possible to cut off most of the code path. |
|
@jerch it should be much faster now that it's forEach instead of the old iterator. The overhead was creating 2 iterators for each cell getting updated. Lovely to use but way too slow to create in this hot code path. I've finished all the gc-related fixes if you want to re-try any tests. |
|
@Tyriar Oh well, I meant the The Anyway - perf issue is fixed 👍 |
|
The work object is a common trick we already used, just new bits were added since. I don't know exactly what variables are optimized away, but |
Fixes #4079
Before:
After: