Making Slack Faster By Being Lazy
Jan 5, 2017

Summary
This post details refactoring the Slack desktop client to improve performance by adopting a lazy loading approach for message fetching, only loading messages for the currently active channel instead of all channels. It also discusses using the `users.counts` API to efficiently display unread and mention states in the channel list, and prioritizes pre-fetching messages for DMs, group DMs, and channels with mentions. The post also covers using 'frecency' (frequency + recency) and keyboard shortcut cues for smarter preloading, and contrasts performance timelines before and after these optimizations, highlighting reduced JavaScript blocking, DOM updates, and memory churn.