This project is discontinued - it's a demo. All data is fake and resets on refresh.
Cache the tessellated mesh per row and only invalidate when the row text or styling actually changes. We keyed the cache on a hash of (text, fg, bg, flags) and frame time dropped off a cliff. Re-tessellating every frame is almost always the culprit.
This is the answer. We did exactly this and went from ~22ms frames to under 6ms on a huge scrollback. Bonus: pool the vertex buffers so you are not reallocating on every dirty row.
Leo Castellano
Makes sense - I am literally rebuilding meshes for unchanged rows every frame. Going to add a dirty flag per row today. Thanks, this is exactly the nudge I needed.
Are you on wgpu? The newer surface configuration + a dedicated staging buffer for atlas updates removed a stall we had on resize. Also double check you are not blocking on queue.submit synchronously.
Profile before you assume it is tessellation, though. For us the real spike was glyph atlas thrashing when scrolling fast through mixed fonts/emoji. An LRU atlas with eviction fixed it.