3 ms·
You might enjoy https://news.ycombinator.com/item?id=11940043 https://news.ycombinator.com/item?id=11940043
by yencabulator 4y ago
You might enjoy https://news.ycombinator.com/item?id=11940043 https://news.ycombinator.com/item?id=11940043
- rcme 4y agoThat was very enjoyable. I think the tldr is that they use custom scrolling via translate3d, limit any computation on the file to just the visible lines, and they split the text into lines with regex to leverage native loops instead of trying to split the next manually via JS. Mono-spaced font probably makes this problem a lot easier as measuring text is pretty trivial.