Abstract
JavaScript is the most popular language on the web and is a crucial component of HTML5 applications and services that run on consumer platforms ranging from desktops to phones. However, despite ample amount of hardware parallelism available to web applications on such platforms, JavaScript web applications remain predominantly sequential. Common parallel programming solutions accepted by other programming languages failed to transfer themselves to JavaScript due to differences in programming models, the additional requirements of the web and different developer expectations.
In this paper we present River Trail - a parallel programming model and API for JavaScript that provides safe, portable, programmer-friendly, deterministic parallelism to JavaScript applications. River Trail allows web applications to effectively utilize multiple cores, vector instructions, and GPUs on client platforms while allowing the web developer to remain within the environment of JavaScript. We describe the implementation of the River Trail compiler and runtime and present experimental results that show the impact of River Trail on performance and scalability for a variety of realistic HTML5 applications. Our experiments show that River Trail has a dramatic positive impact on overall performance and responsiveness of computationally intense JavaScript based applications achieving up to 33.6 times speedup for kernels and up to 11.8 times speedup for realistic web applications compared to sequential JavaScript. Moreover, River Trail enables new interactive web usages that are simply not even possible with standard sequential JavaScript.
- T. Aarnio and M. Bourges-Sévenier. WebCL working draft. https://cvs.khronos.org/svn/repos/registry/trunk/public/webcl/spec/latest/index.html, October 2012.Google Scholar
- M. Anttonen, A. Salminen, T. Mikkonen, and A. Taivalsaari. Transforming the web into a real application platform: new technologies, emerging trends and missing pieces. In Proceedings of the 2011 ACM Symposium on Applied Computing, SAC '11, pages 800--807, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0113-8. Google Scholar
Digital Library
- S. Avidan and A. Shamir. Seam carving for content-aware image resizing. ACM Trans. Graph., 26, July 2007. ISSN 0730-0301. Google Scholar
Digital Library
- R. Berjon, T. Leithead, E. Doyle Navara, E. O'Connor, S. Pfeiffer, and I. Hickson. HTML5. http://dev.w3.org/html5/spec/, November 2012.Google Scholar
- G. E. Blelloch, J. C. Hardwick, J. Sipelstein, M. Zagha, and S. Chatterjee. Implementation of a portable nested data-parallel language. J. Parallel Distrib. Comput., 21(1):4--14, Apr. 1994. ISSN 0743-7315. Google Scholar
Digital Library
- R. L. Bocchino, Jr., V. S. Adve, D. Dig, S. V. Adve, S. Heumann, R. Komuravelli, J. Overbey, P. Simmons, H. Sung, and M. Vakilian. A type and effect system for deterministic parallel Java. In Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications, OOPSLA '09, pages 97--116, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-766-0. Google Scholar
Digital Library
- B. Catanzaro, M. Garland, and K. Keutzer. Copperhead: compiling an embedded data parallel language. In Proceedings of the 16th ACM symposium on Principles and practice of parallel programming, PPoPP '11, pages 47--56, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0119-0. Google Scholar
Digital Library
- M. M. T. Chakravarty, R. Leshchinskiy, S. Peyton Jones, G. Keller, and S. Marlow. Data parallel haskell: a status report. In Proceedings of the 2007 workshop on Declarative aspects of multicore programming, DAMP '07, pages 10--18, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-690-5. Google Scholar
Digital Library
- J. Dean and S. Ghemawat. Mapreduce: simplified data processing on large clusters. Commun. ACM, 51(1):107--113, Jan. 2008. ISSN 0001-0782. Google Scholar
Digital Library
- V. Djeric and A. Goel. Securing script-based extensibility in web browsers. In Proceedings of the 19th USENIX conference on Security, USENIX Security'10, pages 23--23, Berkeley, CA, USA, 2010. USENIX Association. ISBN 888-7-6666-5555-4. Google Scholar
Digital Library
- C. Dubach, P. Cheng, R. Rabbah, D. F. Bacon, and S. J. Fink. Compiling a high-level language for gpus: (via language support for architectures and compilers). In Proceedings of the 33rd ACM SIGPLAN conference on Programming Language Design and Implementation, PLDI '12, pages 1--12, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1205-9. Google Scholar
Digital Library
- G. Farnebäck. Two-frame motion estimation based on polynomial expansion. In Proceedings of the 13th Scandinavian conference on Image analysis, SCIA'03, pages 363--370, Berlin, Heidelberg, 2003. Springer-Verlag. ISBN 3-540-40601-8. Google Scholar
Digital Library
- S. Herhut, R. L. Hudson, T. Shpeisman, and J. Sreeram. Parallel programming for the web. In Proceedings of the 4th USENIX conference on Hot Topics in Parallelism, HotPar'12, pages 1--1, Berkeley, CA, USA, 2012. USENIX Association. Google Scholar
Digital Library
- S. Herhut, R. L. Hudson, T. Shpeisman, and J. Sreeram. ParallelArray API specification. https://github.com/RiverTrail/RiverTrail/wiki/ParallelArray, October 2012.Google Scholar
- R. L. Hudson and S. Herhut. Parallel EcmaScript (River Trail) API. http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism, October 2012.Google Scholar
- K. E. Iverson. A programming language. JohnWiley & Sons, Inc., New York, NY, USA, 1962. ISBN 0-471430-14-5. Google Scholar
Digital Library
- M. Kawaguchi, P. Rondon, A. Bakst, and R. Jhala. Deterministic parallelism via liquid effects. SIGPLAN Not., 47(6): 45--54, June 2012. ISSN 0362-1340. Google Scholar
Digital Library
- H. Masuhara and Y. Nishiguchi. A data-parallel extension to ruby for gpgpu: toward a framework for implementing domain-specific optimizations. In Proceedings of the 9th ECOOP Workshop on Reflection, AOP, and Meta-Data for Software Evolution, RAM-SE '12, pages 3--6, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1277-6. Google Scholar
Digital Library
- N. D. Matsakis. Parallel closures: a new twist on an old idea. In Proceedings of the 4th USENIX conference on Hot Topics in Parallelism, HotPar'12, Berkeley, CA, USA, 2012. USENIX Association. Google Scholar
Digital Library
- Mozilla. Firefox OS. http://www.mozilla.org/en-US/firefoxos/, November 2012.Google Scholar
- A. Munshi. OpenCL specification 1.1. http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf, June 2011.Google Scholar
- C. J. Newburn, B. So, Z. Liu, M. McCool, A. Ghuloum, S. D. Toit, Z. G. Wang, Z. H. Du, Y. Chen, G. Wu, P. Guo, Z. Liu, and D. Zhang. Intel's array building blocks: A retargetable, dynamic compiler and embedded language. In Proceedings of the 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO '11, pages 224--235, Washington, DC, USA, 2011. IEEE Computer Society. ISBN 978-1-61284-356-8. Google Scholar
Digital Library
- N. Nystrom, D. White, and K. Das. Firepile: run-time compilation for gpus in scala. In Proceedings of the 10th ACM international conference on Generative programming and component engineering, GPCE '11, pages 107--116, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0689-8. Google Scholar
Digital Library
- B. C. Pierce. Types and programming languages. MIT Press, Cambridge, MA, USA, 2002. ISBN 0-262-16209-1. Google Scholar
Digital Library
- A. Pignotti, A. Welc, and B. Mathiske. Adaptive data parallelism for internet clients on heterogeneous platforms. In Proceedings of the 8th symposium on Dynamic languages, DLS '12, pages 53--62, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1564-7. Google Scholar
Digital Library
- P. Ratanaworabhan, B. Livshits, and B. G. Zorn. Jsmeter: comparing the behavior of JavaScript benchmarks with real web applications. In Proceedings of the 2010 USENIX conference on Web application development, WebApps'10, Berkeley, CA, USA, 2010. USENIX Association. Google Scholar
Digital Library
- G. Richards, S. Lebresne, B. Burg, and J. Vitek. An analysis of the dynamic behavior of JavaScript programs. In Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation, PLDI '10, pages 1--12, New York, NY, USA, 2010. ACM. ISBN 978-1-4503-0019-3. Google Scholar
Digital Library
- S. Singh. Declarative data-parallel programming with the accelerator system. In Proceedings of the 5th ACM SIGPLAN workshop on Declarative aspects of multicore programming, DAMP '10, New York, NY, USA, 2010. ACM. ISBN 978-1-60558-859-9. Google Scholar
Digital Library
- J. Sreeram, S. Herhut, R. L. Hudson, and T. Shpeisman. Teaching parallelism with river trail. In Proceedings of the 2012 workshop on Developing competency in parallelism: techniques for education and training, DCP '12, pages 1--8, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1840-2. Google Scholar
Digital Library
- D. Tiwari and Y. Solihin. Architectural characterization and similarity analysis of sunspider and Google's v8 Java-Script benchmarks. In Performance Analysis of Systems and Software (ISPASS), 2012 IEEE International Symposium on, pages 221 --232, april 2012. Google Scholar
Digital Library
Index Terms
River trail: a path to parallelism in JavaScript
Recommendations
TigerQuoll: parallel event-based JavaScript
PPoPP '13JavaScript, the most popular language on the Web, is rapidly moving to the server-side, becoming even more pervasive. Still, JavaScript lacks support for shared memory parallelism, making it challenging for developers to exploit multicores present in ...
River trail: a path to parallelism in JavaScript
OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applicationsJavaScript is the most popular language on the web and is a crucial component of HTML5 applications and services that run on consumer platforms ranging from desktops to phones. However, despite ample amount of hardware parallelism available to web ...
Teaching parallelism with river trail
DCP '12: Proceedings of the 2012 workshop on Developing competency in parallelism: techniques for education and trainingParallel hardware is today's reality and parallel programming models exist for most mainstream languages. Surprisingly JavaScript, the mother tongue of the web, is still stuck in its sequential past. JavaScript's unique programming model, the web's ...







Comments