Dynamically accelerating client-side web applications through decoupled execution

The emergence and wide adoption of web applications have moved the client-side component, often written in JavaScript, to the forefront of computing on the web. Web application developers try to move more computation to the client side to avoid unnecessary network traffic and make the applications more responsive. Therefore, JavaScript applications are becoming larger and more computation intensive. Trace-based just-in-time compilation have been proposed to address the performance bottleneck in these applications. In this paper, we exploit the extra processing power in multicore systems to further improve the performance of trace-based execution of JavaScript programs. In trace-based engines, a considerable portion of execution time is spent on running guards which are operations inserted in the native code to check if the properties assumed by the compiled code actually hold during execution. We introduce ParaGuard to off-load these guards to another thread, while speculatively executing the main trace. In a manner similar to what happens in current trace-based JITs, if a check fails, ParaGuard aborts the native trace execution and reverts back to interpreting the JavaScript bytecode. We also propose several optimizations including guard branch aggregation and profile-based snapshot elimination to further improve the performance of our technique. We show that ParaGuard can achieve an average of 15% performance improvement over current trace-based compilers using an extra processor on commodity multicore processors.

[1]  Christof Fetzer,et al.  Speculation for Parallelizing Runtime Checks , 2009, SSS.

[2]  Gurindar S. Sohi,et al.  Master/slave speculative parallelization , 2002, MICRO.

[3]  Brian T. Lewis,et al.  Compiler and runtime support for efficient software transactional memory , 2006, PLDI '06.

[4]  Lawrence Rauchwerger,et al.  The LRPD test: speculative run-time parallelization of loops with privatization and reduction parallelization , 1995, PLDI '95.

[5]  Mason Chang,et al.  Trace-based just-in-time type specialization for dynamic languages , 2009, PLDI '09.

[6]  Jan Vitek,et al.  An analysis of the dynamic behavior of JavaScript programs , 2010, PLDI '10.

[7]  Michael Franz,et al.  Tracing for web 3.0: trace compilation for the next generation web applications , 2009, VEE '09.

[8]  Benjamin Livshits,et al.  JSMeter: Characterizing Real-World Behavior of JavaScript Programs , 2009 .

[9]  Chen Ding,et al.  Fast Track: A Software System for Speculative Program Optimization , 2009, 2009 International Symposium on Code Generation and Optimization.

[10]  Olatunji Ruwase,et al.  Parallelizing dynamic information flow tracking , 2008, SPAA '08.

[11]  Christof Fetzer,et al.  Prospect: a compiler framework for speculative parallelization , 2010, CGO '10.

[12]  Arun Raman,et al.  Speculative parallelization using software multi-threaded transactions , 2010, ASPLOS XV.

[13]  Jason Flinn,et al.  Parallelizing security checks on commodity hardware , 2008, ASPLOS.

[14]  Vasanth Bala,et al.  Dynamo: a transparent dynamic optimization system , 2000, SIGP.

[15]  Eric Rotenberg,et al.  A study of slipstream processors , 2000, MICRO 33.

[16]  James R. Larus,et al.  Transactional Memory, 2nd edition , 2010, Transactional Memory.

[17]  Dean M. Tullsen,et al.  Mitosis compiler: an infrastructure for speculative threading based on pre-computation slices , 2005, PLDI '05.

[18]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[19]  Mark Plesko,et al.  Optimizing memory transactions , 2006, PLDI '06.