Summarize from Dropbox Tech.

Dropbox的用户体验和系统优化做到极致,而且还在不断优化中,看了一下技术文章,除了Python的优化之外,其它的优化点可以总结为一下几点:

1, Non-blocking user intereact.

The big lesson we learned from building the Dropbox app photos tab was: don’t block the user! Instead of requiring changes to be propagated to the server synchronously, we built Carousel from day one as an eventually consistent system. With mobile networks still slow and unreliable, we knew this would be the only way to deliver a Dropbox-backed gallery that felt fast and local.

The asynchronous, delta-based design to our mobile library empowered us to build an app that was much faster than the Dropbox photos tab. This design enabled us to hide the latency between client and server from the user. In the next installation of this series, we’ll go into more depth on the latency between disk and memory, and how optimizing that was also critical to making the app feel fast.

尽量不要阻塞用户操作(不要弹出loading这类),能异步的操作都应该马上在local反馈结果,然后异步的发向服务器。Dropbox的实现是通过把Operation都记录到本地SQLITE,保证操作不会丢失。

2, Batching requests.

一次请求会带多个缩略图文件的下载,然后服务器压缩返回,如:

GET https://photos.dropbox.com/thumbnails_batch?paths=
    /path/to/thumb0.jpg,/path/to/thumb1.jpg,[...],/path/to/thumbN.jpg

.

HTTP/1.1 200 OK
Cache-Control: public
Content-Encoding: gzip
Content-Type: text/plain
Transfer-Encoding: chunked

1:data:image/jpeg;base64,4AAQ4BQY5FBAYmI4B[...]
0:data:image/jpeg;base64,I8FWC3EAj+4K846AF[...]
3:data:image/jpeg;base64,houN3VmI4BA3+BQA3[...]
2:data:image/jpeg;base64,MH3Gw15u56bHP67jF[...]
[...]

这样可以同样适用于web,突破浏览器每个域名并发6个连接的极限。通过压缩批量下载,并且做cache处理,可以有效提升缩略图下载速度。

3, SPDY.

Since the scheme is relatively simple and uses plain HTTPS instead of SPDY, it allowed us to deploy it on all platforms and we saw significant performance improvements: 40% page load time improvement on web.

However, we don’t see this as a long-term strategy – we’re planning on adding SPDY support to all of our clients and take care of pipelining at the protocol level. This will simplify the code, give us similar performance improvements and better cacheability (see note about consistent batches above).

目前Dropbox也还在努力做SPDY的尝试,从协议层去做优化(看这个文章时可能已经有这个特性了),从而达到一次SSL握手,以后都在上面做request的方式来做网络请求。

4, Delta

增量的上传和下载,这个就不用多说了。



评论需要翻墙 for disqus