Making JavaScript Better by Making It Even Slower

On mobile devices, such as smart phones and tablets, client-side JavaScript is a significant contributor to power consumption, and thus battery lifetime. We claim that this is partially due to JavaScript interpretation running faster than is necessary to maintain a satisfactory user experience, and we propose that JavaScript implementations include a user-configurable throttle. To evaluate our claim we developed a web proxy system, named JSSlow, that reduces power consumption by transcoding client-side JavaScript and injecting "sleep" invocations. This can be done safely, even given JavaScript's single-threaded nature, through the use of continuation passing, and the proxy model requires neither server nor client-side changes. Using JSSlow we studied the 120 most popular sites and found that the technique could reduce power consumption by an average of 5% on Android phones. We also considered buggy code (52% reduction) and advertising (10% reduction). To evaluate the system's impact on the user experience, we conducted a user study consisting of interactive tasks the user carried out on. The perceived performance impact varies by user and site, with the variation being highest on the most interactive sites, such as games. This argues for making the throttle user-configurable in some cases.

[1]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[2]  Peter A. Dinda,et al.  User-driven scheduling of interactive virtual machines , 2004, Fifth IEEE/ACM International Workshop on Grid Computing.

[3]  David Garlan,et al.  Giving Users the Steering Wheel for Guiding Resource-Adaptive Systems , 2005 .

[4]  Marios C. Papaefthymiou,et al.  Computational sprinting , 2012, IEEE International Symposium on High-Performance Comp Architecture.

[5]  Peter A. Dinda,et al.  EmNet: Satisfying The Individual User Through Empathic Home Networks , 2010, INFOCOM.

[6]  Peter A. Dinda,et al.  VSched: Mixing Batch And Interactive Virtual Machines Using Periodic Real-time Scheduling , 2005, ACM/IEEE SC 2005 Conference (SC'05).

[7]  Stuart Cheshire,et al.  Latency and the quest for interactivity , 1996 .

[8]  Peter A. Dinda,et al.  EmNet: Satisfying The Individual User Through Empathic Home Networks , 2010, 2010 Proceedings IEEE INFOCOM.

[9]  Eddie Kohler,et al.  Events Can Make Sense , 2007, USENIX Annual Technical Conference.

[10]  Peter A. Dinda,et al.  Power to the people: Leveraging human physiological traits to control microprocessor frequency , 2008, 2008 41st IEEE/ACM International Symposium on Microarchitecture.

[11]  Dan Boneh,et al.  Who killed my battery?: analyzing mobile browser energy consumption , 2012, WWW.

[12]  Gerald J. Sussman,et al.  Scheme: A Interpreter for Extended Lambda Calculus , 1998, High. Order Symb. Comput..