Improving Chat Rendering Performance
Article Summary
Twitch was dropping frames like crazy. Chat messages were taking 200ms to render when they had just 16.667ms to work with for smooth 60fps video.
Ben Swartz from Twitch's engineering team shares how they tackled chat rendering performance issues as their platform scaled. With tens of messages per second in busy channels, the team needed to optimize their Ember-based chat system without sacrificing the core Twitch experience.
Key Takeaways
- Batching message updates every 100ms halved render time in busy chat rooms
- Removing wrapper components and switching to CSS tooltips cut 0.25-0.5ms per component
- Replacing computed properties with lazy getters reduced 100-message render time by 10%
- Each additional Ember component adds measurable overhead during high-frequency rendering
Critical Insight
By batching updates, eliminating unnecessary components, and removing computed properties, Twitch reduced chat render times from 200ms+ down to manageable levels that prevent frame drops.