JavaScript Parallelizing Compiler for Exploiting Parallelism from Data-Parallel HTML5 Applications

With the advent of the HTML5 standard, JavaScript is increasingly processing computationally intensive, data-parallel workloads. Thus, the enhancement of JavaScript performance has been emphasized because the performance gap between JavaScript and native applications is still substantial. Despite this urgency, conventional JavaScript compilers do not exploit much of parallelism even from data-parallel JavaScript applications, despite contemporary mobile devices being equipped with expensive parallel hardware platforms, such as multicore processors and GPGPUs. In this article, we propose an automatically parallelizing JavaScript compiler that targets emerging, data-parallel HTML5 applications by leveraging the mature affine loop analysis of conventional static compilers. We identify that the most critical issues when parallelizing JavaScript with a conventional static analysis are ensuring correct parallelization, minimizing compilation overhead, and conducting low-cost recovery when there is a speculation failure during parallel execution. We propose a mechanism for safely handling the failure at a low cost, based on compiler techniques and the property of idempotence. Our experiment shows that the proposed JavaScript parallelizing compiler detects most affine parallel loops. Also, we achieved a maximum speedup of 3.22 times on a quad-core system, while incurring negligible compilation and recovery overheads with various sets of data-parallel HTML5 applications.

[1]  Håkan Grahn,et al.  The Effects of Parameter Tuning in Software Thread-Level Speculation in JavaScript Engines , 2014, ACM Trans. Archit. Code Optim..

[2]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[3]  Karthikeyan Sankaralingam,et al.  iGPU: Exception support and speculative execution on GPUs , 2012, 2012 39th Annual International Symposium on Computer Architecture (ISCA).

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

[5]  Monica S. Lam,et al.  A Loop Transformation Theory and an Algorithm to Maximize Parallelism , 1991, IEEE Trans. Parallel Distributed Syst..

[6]  Taesoon Park,et al.  Checkpointing and rollback-recovery in distributed systems , 1989 .

[7]  G. Amdhal,et al.  Validity of the single processor approach to achieving large scale computing capabilities , 1967, AFIPS '67 (Spring).

[8]  Tomofumi Yuki Understanding PolyBench/C 3.2 Kernels , 2014 .

[9]  Babak Falsafi,et al.  Exploiting reference idempotency to reduce speculative storage overflow , 2006, TOPL.

[10]  Scott A. Mahlke,et al.  Automatic speculative DOALL for clusters , 2012, CGO '12.

[11]  David A. Padua,et al.  Programming for parallelism and locality with hierarchically tiled arrays , 2006, PPoPP '06.

[12]  Albert Cohen,et al.  Coarse-Grained Loop Parallelization: Iteration Space Slicing vs Affine Transformations , 2009, 2009 Eighth International Symposium on Parallel and Distributed Computing.

[13]  D. Flannanghan JavaScript: The definitive guide , 1999 .

[14]  Utpal Banerjee,et al.  Dependence analysis for supercomputing , 1988, The Kluwer international series in engineering and computer science.

[15]  Youngsun Han,et al.  Web-based image processing using JavaScript and WebCL , 2014, 2014 IEEE International Conference on Consumer Electronics (ICCE).

[16]  Babak Falsafi,et al.  Multiplex: unifying conventional and speculative thread-level parallelism on a chip multiprocessor , 2001, ICS '01.

[17]  Scott A. Mahlke,et al.  Parallelizing sequential applications on commodity hardware using a low-cost software transactional memory , 2009, PLDI '09.

[18]  Håkan Grahn,et al.  Using speculation to enhance javascript performance in web applications , 2013, IEEE Internet Computing.

[19]  Gu-Yeon Wei,et al.  HELIX: automatic parallelization of irregular programs for chip multiprocessing , 2012, CGO '12.

[20]  Stephen J. Fink,et al.  Design, implementation and evaluation of adaptive recompilation with on-stack replacement , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[21]  Ken Kennedy,et al.  Optimizing Compilers for Modern Architectures: A Dependence-based Approach , 2001 .

[22]  Christian Lengauer,et al.  Polly - Performing Polyhedral Optimizations on a Low-Level Intermediate Representation , 2012, Parallel Process. Lett..

[23]  Michael Hind,et al.  Pointer analysis: haven't we solved this problem yet? , 2001, PASTE '01.

[24]  Tatiana Shpeisman,et al.  River trail: a path to parallelism in JavaScript , 2013, OOPSLA.

[25]  Amer Diwan,et al.  Type-based alias analysis , 1998, PLDI.

[26]  Anders M. Dale,et al.  A web-portal for interactive data exploration, visualization, and hypothesis testing , 2014, Front. Neuroinform..

[27]  Benjamin Livshits,et al.  JSMeter: Comparing the Behavior of JavaScript Benchmarks with Real Web Applications , 2010, WebApps.

[28]  Arthur J. Bernstein,et al.  Analysis of Programs for Parallel Processing , 1966, IEEE Trans. Electron. Comput..

[29]  Lawrence Rauchwerger,et al.  The privatizing DOALL test: a run-time technique for DOALL loop identification and array privatization , 1994, ICS '94.

[30]  Tommi Mikkonen,et al.  Transforming the web into a real application platform: new technologies, emerging trends and missing pieces , 2011, SAC.

[31]  Somesh Jha,et al.  Static analysis and compiler design for idempotent processing , 2012, PLDI.

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

[33]  Rajeev Barua,et al.  AESOP : The Autoparallelizing Compiler for Shared Memory Computers , 2013 .

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

[35]  Gu-Yeon Wei,et al.  HELIX-RC: An architecture-compiler co-design for automatic parallelization of irregular programs , 2014, 2014 ACM/IEEE 41st International Symposium on Computer Architecture (ISCA).

[36]  Scott A. Mahlke,et al.  Dynamic parallelization of JavaScript applications using an ultra-lightweight speculation mechanism , 2011, 2011 IEEE 17th International Symposium on High Performance Computer Architecture.