skip to main content
research-article

River trail: a path to parallelism in JavaScript

Published:29 October 2013Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Avidan and A. Shamir. Seam carving for content-aware image resizing. ACM Trans. Graph., 26, July 2007. ISSN 0730-0301. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle Scholar
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Dean and S. Ghemawat. Mapreduce: simplified data processing on large clusters. Commun. ACM, 51(1):107--113, Jan. 2008. ISSN 0001-0782. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Herhut, R. L. Hudson, T. Shpeisman, and J. Sreeram. ParallelArray API specification. https://github.com/RiverTrail/RiverTrail/wiki/ParallelArray, October 2012.Google ScholarGoogle Scholar
  15. R. L. Hudson and S. Herhut. Parallel EcmaScript (River Trail) API. http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism, October 2012.Google ScholarGoogle Scholar
  16. K. E. Iverson. A programming language. JohnWiley & Sons, Inc., New York, NY, USA, 1962. ISBN 0-471430-14-5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. Mozilla. Firefox OS. http://www.mozilla.org/en-US/firefoxos/, November 2012.Google ScholarGoogle Scholar
  21. A. Munshi. OpenCL specification 1.1. http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf, June 2011.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. B. C. Pierce. Types and programming languages. MIT Press, Cambridge, MA, USA, 2002. ISBN 0-262-16209-1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. River trail: a path to parallelism in JavaScript

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 48, Issue 10
          OOPSLA '13
          October 2013
          867 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2544173
          Issue’s Table of Contents
          • cover image ACM Conferences
            OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applications
            October 2013
            904 pages
            ISBN:9781450323741
            DOI:10.1145/2509136

          Copyright © 2013 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 October 2013

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!