Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For my own realtime browser based ASCII projects I update the DOM “manually”: the biggest bottleneck is frequent -horizontal- changes in color as each character with a new color needs to be wrapped in its own <span> element. After all you can’t avoid a DOM repaint.

After several benchmarks I realized that the fastest way to update the entire window is to compose a string and assign it to each line/line-element via innerHTML. I usually get 60fps with 5-8k chars in fullscreen (browser text rendering has become really fast).



Maybe you could benchmark it against this. It would make an interest HN followup post.


It's not the rendering / DOM part that got 50x faster though, so that would be apples to oranges.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: