Making Slack Faster By Being Lazy
Article Summary
Slack cut load times by 65% for large teams by doing less work, not more. Their secret? Strategic laziness.
Staff Engineer Scott Schiller breaks down how Slack's desktop client went from loading everything at startup to intelligently deferring and predicting what users actually need. The refactor tackled performance bottlenecks that emerged as teams scaled from 100 to thousands of members.
Key Takeaways
- Replaced individual channel API calls with single users.counts method, eliminating DOM thrashing
- Standardized message pagination to 42 messages per channel based on actual usage patterns
- Built frecency algorithm to prefetch channels using Quick Switcher and viewing history
- Added keyboard navigation preloading: fetch one channel ahead during alt+up/down browsing
- Achieved 10% faster loads generally, 65% improvement for extreme stress test cases
Critical Insight
By deferring message loading, batching API calls, and predicting user behavior, Slack made their client responsive for massive teams without waiting for complete data.