X (formerly Twitter)

X (Twitter)'s CocoaSPDY: SPDY For iOS and OS X

Original post CocoaSPDY: SPDY For iOS and OS X

Article Summary

Twitter just made mobile apps 30% faster with a single line of code. Here's how they did it and why they're giving it away for free.

Twitter Engineering open sourced CocoaSPDY, bringing the SPDY protocol (HTTP's experimental successor) to iOS and OS X apps. The framework integrates with existing apps via a single line of code, leveraging Apple's NSURLProtocol interface.

Key Takeaways

Critical Insight

Twitter achieved 30% faster API requests on mobile by implementing SPDY, with the biggest wins coming from poor network conditions.

Continue reading

What This Article Covers

Problem

Mobile users on cellular networks were dealing with high latency. The problem came down to too many back-and-forth requests between client and server. HTTP's design, while human-readable, didn't leave much room for optimization on slower connections.

Solution

Twitter built CocoaSPDY, a binary protocol written in Objective-C. It swaps out HTTP for SPDY's multiplexing, and it works directly with NSURLConnection and NSURLSession without any friction.

Impact

SPDY cut latency across different network conditions. The biggest wins showed up at the 95th and 99th percentile of poor cellular connections, which is exactly where users were struggling the most.

The performance charts reveal exactly where SPDY shines and why the 99th percentile tells a different story than the median.

This page summarizes “CocoaSPDY: SPDY For iOS and OS X” by X (formerly Twitter), published Dec 19, 2013. All credit for the original work goes to the authors.

Read the original on blog.x.com (opens in new tab)

AI tools for iOS

Browse all AI tools →