26 April 2015

Stats for Chrome's Compression Proxy


A few Google engineers wrote an interesting paper about Flywheel, Google Chrome's data compression proxy. The paper only talks about the data compression feature from Chrome for Android and iOS and offers a lot of stats.


Flywheel focuses on the mobile web because mobile devices "are fast becoming the dominant mode of Internet access", while "web content is still predominantly designed for desktop browsers" and mobile data is expensive. Google's proxy compresses web content by 58% on average and relies on the SPDY protocol and the WebP image compression formats, which are used by a small percentage of the sites (0.8% of the images use WebP and 0.9% of the sites use SPDY). The most significant data reduction comes from image transcoding, which decreases the sizes of the images by 66.4%, on average.


Data compression is disabled by default and only 9% of the mobile Chrome users enabled it. "Segmented by access network, 78% of page loads are transferred via WiFi, 11% via 3G, 9% via 4G/LTE, and 1% via 2G." Flywheel is not enabled for HTTPS pages and for incognito tabs and it's interesting to notice that only 37% of the bytes downloaded by Chrome users who enabled the proxy are received from Flywheel, while 50% of the total received bytes are from HTTPS and 13% of the bytes are from incognito mode, bypassed URLs and protocols other than HTTP/HTTPS. For example, the proxy bypasses audio/video files and large file downloads.

"For most users and most page loads, Flywheel increases page load time. For the majority of page loads, the increase is modest: the median value increases by 6%. Flywheel improves page load time only when pages are large and users are close to a Google data center."

{ via Hacker News }

Your Mobile Phone can Detect Earthquakes


Was it just you or did the ground really shake? Your iPhone, iPad and most newer mobile phones can work as basic seismometers, the same instrument that is used to measure the magnitude of earthquakes and volcanoes. You don’t need to install any apps, just the built-in web browser would suffice.

OK, try this. Launch Google Chrome or the Safari browser on your mobile phone (or tablet) and then open this page. You should see a continuously moving waveform but if you slightly shake or tilt your mobile device,  simulating seismic activity, the graph will capture these movements in real-time much like a seismograph.

The seismic intensity will vary depending on how vigorously (or slowly) you are shaking the phone (see the following screenshot) and will also change based on the orientation of the device. And you’ll be surprised to learn that this basic seismograph is written using simple JavaScript.

earthquake seismograph

Most newer mobile devices have built-in accelerometers and gyroscopes and as you move the physical hardware, the changes in the orientation of the device and acceleration are detected by the browser which are then mapped into the seismograph.

The orientation and motion data are in turn captured by the HTML5 DeviceOrientation and DeviceMotion events of the browser. This works mostly on mobile devices but if you are using Google Chrome on the desktop, you can turn on the Accelerator option under Sensors inside Chrome Dev Tools to simulate motion.

Update: The code was originally published on isthisanearthquake.com in 2011 but the domain is no longer available. A mirror is located on ctrlq.org.


The story, Your Mobile Phone can Detect Earthquakes, was originally published at Digital Inspiration by Amit Agarwal on 25/04/2015 under JavaScript, Internet.