Abstract
From its modest beginnings as a tool to validate forms, JavaScript is now an industrial-strength language used to power online applications such as spreadsheets, IDEs, image editors and even 3D games. Since all modern web browsers support JavaScript, it provides a medium that is both easy to distribute for developers and easy to access for users. This paper provides empirical data to answer the question: Is JavaScript fast enough for numerical computations? By measuring and comparing the runtime performance of benchmarks representative of a wide variety of scientific applications, we show that sequential JavaScript is within a factor of 2 of native code. Parallel code using WebCL shows speed improvements of up to 2.28 over JavaScript for the majority of the benchmarks.
- asm.js. URL http://asmjs.org/spec/latest/.Google Scholar
- Cascading style sheets (CSS) snapshot 2010. URL http://www.w3.org/TR/css-2010/.Google Scholar
- dart2js. URL https://www.dartlang.org/tools/dart2js.Google Scholar
- Emscripten. URL http://emscripten.org.Google Scholar
- Google web toolkit. URL http://www.gwtproject.org/.Google Scholar
- A vocabulary and associated APIs for HTML and XHTML. URL http://www.w3.org/TR/html5/.Google Scholar
- Standard ECMA-262 ECMAScript language specification edition 5.1 (june 2011). URL http://www.ecma-international.org/publications/standards/Ecma-262.htm.Google Scholar
- Kraken Benchmark Suite. URL http://krakenbenchmark.mozilla.org/.Google Scholar
- Octane Benchmark Suite. URL https://developers.google.com/octane/.Google Scholar
- Opal: Ruby to JavaScript compiler. URL http://opalrb.org/.Google Scholar
- OpenCL. URL https://www.khronos.org/opencl/.Google Scholar
- Pyjs. URL http://pyjs.org/.Google Scholar
- Profile your web application with v8's internal profiler. URL https://developers.google.com/v8/profiler_example.Google Scholar
- WebGL specifications. URL http://www.khronos.org/registry/webgl/specs/latest/.Google Scholar
- WebCL specification. May 2014. URL http://www.khronos.org/registry/webcl/specs/latest/1.0/.Google Scholar
- K. Asanovic, R. Bodik, B. C. Catanzaro, J. J. Gebis, P. Husbands, et al. The landscape of parallel computing research: A view from berkeley. Technical Report UCB/EECS-2006-183, EECS Department, University of California, Berkeley.Google Scholar
- R. Auler, E. Borin, P. de Halleux, M. Moskal, and N. Tillmann. Addressing JavaScript JIT Engines Performance Quirks: A Crowd- sourced Adaptive Compiler. In CC.(2014).Google Scholar
- L. Bak. Google chrome's need for speed. URL http://blog.chromium.org/2008/09/google-chromes-need-for-speed_02.html.Google Scholar
- J. Bezanson, S. Karpinski, V. B. Shah, and A. Edelman. Julia: A Fast Dynamic Language for Technical Computing. CoRR, abs/1209.5145, 2012.Google Scholar
- M. Bodin, A. Chargueraud, D. Filaretti, P. Gardner, et al. A Trusted Mechanised JavaSript Specification. In POPL.(2014). Google Scholar
Digital Library
- A. Casey, J. Li, J. Doherty, M. C. Boisvert, T. Aslam, et al. McLab: An Extensible Compiler Toolkit for MATLAB and Related Languages. In C3S2E.(2010). Google Scholar
Digital Library
- S. Che, M. Boyer, J. Meng, D. Tarjan, et al. Rodinia: A benchmark suite for heterogeneous computing. In IISWC.(2009). Google Scholar
Digital Library
- J. Coglan. Sylvester: Vector and Matrix math for JavaScript.Google Scholar
- P. Colella. Defining software requirements for scientific computing, 2004.Google Scholar
- J. de Jong. math.js. URL http://mathjs.org/.Google Scholar
- M. Elsman. SMLtoJs: Hosting a standard ML compiler in a web browser. In PLASTIC.(2011). Google Scholar
Digital Library
- W. C. Feng, H. Lin, T. Scogland, and J. Zhang. OpenCL and the 13 Dwarfs: A Work in Progress. In ICPE.(2012). Google Scholar
Digital Library
- J. Fifield and D. Grunwald. A Methodology for Fine-Grained Parallelism in JavaScript Applications. In Languages and Compilers for Parallel Computing, volume 7146 of LNCS, pages 16--30. 2013.Google Scholar
Cross Ref
- A. Gal, B. Eich, M. Shaver, D. Anderson, et al. Trace-based Just-in- time Type Specialization for Dynamic Languages. In PLDI.(2009). Google Scholar
Digital Library
- A. Grosskurth and M. W. Godfrey. A Reference Architecture for Web Browsers. In ICSM.(2005). Google Scholar
Digital Library
- S. Herhut, R. L. Hudson, T. Shpeisman, and J. Sreeram. River Trail: A Path to Parallelism in JavaScript. In OOPSLA.(2013). Google Scholar
Digital Library
- R. Krahn, J. Lincke, and R. Hirschfeld. Efficient Layer Activation in Context JS. In C5.(2012). Google Scholar
Digital Library
- J. Larres, A. Potanin, and Y. Hirose. A Study of Performance Variations in the Mozilla Firefox Web Browser. In ACSC.(2013). Google Scholar
Digital Library
- S. Loisel. Numeric Javascript. URL http://numericjs.com/.Google Scholar
- M. Mehrara, P.-C. Hsu, M. Samadi, and S. Mahlke. Dynamic parallelization of JavaScript applications using an ultra-lightweight speculation mechanism. In HPCA.(2011). Google Scholar
Digital Library
- L. A. Meyerovich, M. E. Torok, E. Atkinson, and R. Bodík. Super-conductor: A Language for Big Data Visualization, 2013.Google Scholar
- F. Morandat, B. Hill, L. Osvald, and J. Vitek. Evaluating the Design of the R Language: Objects and Functions for Data Analysis. In ECOOP.(2012). Google Scholar
Digital Library
- F. Pizlo. JetStream Benchmark Suite. URL https://www.webkit.org/blog/3418/introducing-the-jetstream-benchmark-suite/.Google Scholar
- C. Reis and S. D. Gribble. Isolating Web Programs in Modern Browser Architectures. In EuroSys.(2009). Google Scholar
Digital Library
- G. Richards. JSBench Benchmark Suite. URL http://jsbench.cs.purdue.edu/.Google Scholar
- G. Richards, A. Gal, B. Eich, and J. Vitek. Automated Construction of JavaScript Benchmarks. In OOPSLA.(2011), . Google Scholar
Digital Library
- G. Richards, S. Lebresne, B. Burg, and J. Vitek. An analysis of the dynamic behavior of javascript programs. In PLDI.(2010), . Google Scholar
Digital Library
- C. Severance. JavaScript: Designing a language in 10 days. Computer, 45(2):7--8, Feb. 2012. ISSN 0018-9162. . Google Scholar
Digital Library
- D. Yoo and S. Krishnamurthi. Whalesong: Running racket in the browser. In DLS.(2013). Google Scholar
Digital Library
- A. Zakai. Emscripten: An LLVM-to-JavaScript compiler. In OOPSLA.(2011). Google Scholar
Digital Library
Index Terms
Using JavaScript and WebCL for numerical computations: a comparative study of native and web technologies
Recommendations
Using JavaScript and WebCL for numerical computations: a comparative study of native and web technologies
DLS '14: Proceedings of the 10th ACM Symposium on Dynamic languagesFrom its modest beginnings as a tool to validate forms, JavaScript is now an industrial-strength language used to power online applications such as spreadsheets, IDEs, image editors and even 3D games. Since all modern web browsers support JavaScript, it ...
O2WebCL: an automatic OpenCL-to-WebCL translator for high performance web computing
HTML5 has become very attractive for cross-platform applications on software-side. Likewise, GPU has increased in popularity due to its energy efficiency of parallel execution on hardware-side. JavaScript, which performs dynamic operations of HTML5, is ...
A SIMD programming model for dart, javascript,and other dynamically typed scripting languages
WPMVP '14: Proceedings of the 2014 Workshop on Programming models for SIMD/Vector processingIt has not been possible to take advantage of the SIMD co-processors available in all x86 and most ARM processors shipping today in dynamically typed scripting languages. Web browsers have become a mainstream platform to deliver large and complex ...







Comments