Abstract
JavaScript has long outpaced its original target applications, being used not only for coding complex web clients, but also web servers, game development and even desktop applications. The most appealing advantage of moving applications to JavaScript is its capability to run the same code in a large number of different devices. It is not surprising that many compilers target JavaScript as an intermediate language. However, writing optimizations and analyses passes for a compiler that emits JavaScript is challenging: a long time spent in optimizing the code in a certain way can be excellent for some browsers, but a futile effort for others. For example, we show that applying JavaScript code optimizations in a tablet with Windows 8 and Internet Explorer 11 increased performance by, on average, 5 times, while running in a desktop with Windows 7 and Firefox decreased performance by 20%. Such a scenario demands a radical new solution for the traditional compiler optimization flow. This paper proposes collecting web clients performance data to build a crowdsourced compiler flag suggestion system in the cloud that helps the compiler perform the appropriate optimizations for each client platform. Since this information comes from crowdsourcing rather than manual investigations, fruitless or harmful optimizations are automatically discarded. Our approach is based on live measurements done while clients use the application on real platforms, proposing a new paradigm on how optimizations are tested.
Chapter PDF
Similar content being viewed by others
References
Develop High Performance Windows 8 Application with HTML 5 and JavaScript, http://blogs.msdn.com/b/dorischen/archive/2013/04/26/develop-high-performance-windows-8-application-with-html5-and-javascript-best-practices-amp-tips.aspx
Google Web Toolkit Page, http://www.gwtproject.org/
Mozilla SpiderMonkey JavaScript Engine, https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
The Computer Language Benchmarks Game, http://benchmarksgame.alioth.debian.org/
The Dart Language Web Page, https://www.dartlang.org/
The New JavaScript Engine in Internet Explorer 9, http://blogs.msdn.com/b/ie/archive/2010/03/18/the-new-javascript-engine-in-internet-explorer-9.aspx
The TypeScript Language Web Page, http://www.typescriptlang.org/
The WebKit Open Source Project, http://webkit.org/
V8 JavaScript Engine, http://code.google.com/p/v8
Adve, V., Lattner, C., Brukman, M., Shukla, A., Gaeke, B.: LLVA: A low-level virtual instruction set architecture. In: MICRO 36 (2003)
Appel, A.W.: Compiling with continuations. Cambridge University Press, New York (1992)
Bebenita, M., Brandner, F., Fahndrich, M., Logozzo, F., Schulte, W., Tillmann, N., Venter, H.: SPUR: A trace-based JIT compiler for CIL. In: OOPSLA 2010. ACM (2010)
Cavazos, J., OâBoyle, M.F.P.: Method-specific dynamic compilation using logistic regression. In: OOPSLA 2006. ACM (2006)
Cooper, K.D., Grosul, A., Harvey, T.J., Reeves, S., Subramanian, D., Torczon, L., Waterman, T.: Acme: Adaptive compilation made efficient. In: LCTES 2005 (2005)
Free Software Foundation, Inc. Using the GNU compiler collection, For GCC version 4.9.0. (March 2013)
Fursin, G., Miranda, C., Temam, O., Namolaru, M., Yom-Tov, E., Zaks, A., Mendelson, B., Bonilla, E., Thomson, J., Leather, H., et al.: MILEPOST GCC: Machine learning based research compiler. In: GCC Summit (2008)
Gizas, A., Christodoulou, S.P., Papatheodorou, T.S.: Comparative evaluation of javascript frameworks. In: 21st International Conference Companion on World Wide Web (2012)
Guthaus, M.R., Ringenberg, J.S., Ernst, D., Austin, T.M., Mudge, T., Brown, R.B.: MiBench: A free, commercially representative embedded benchmark suite. In: IISWC 2001. IEEE (2001)
Haneda, M., Knijnenburg, P.M., Wijshoff, H.A.: Automatic selection of compiler options using non-parametric inferential statistics. In: PaCT 2005. IEEE (2005)
Hoste, K., Georges, A., Eeckhout, L.: Automated just-in-time compiler tuning. In: CGO 2010. ACM (2010)
Jeon, S., Choi, J.: Reuse of JIT compiled code in JavaScript engine. In: 27th Annual ACM Symposium on Applied Computing (2012)
Lee, S.-W., Moon, S.-M.: Selective just-in-time compilation for client-side mobile javascript engine. In: CASES 2011. ACM (2011)
Lee, S.-W., Moon, S.-M., Kim, W.-J., Jin Oh, S., Oh, H.-S.: Code size and performance optimization for mobile JavaScript just-in-time compiler. In: 2010 Workshop on Interaction between Compilers and Computer Architecture (2010)
Martinsen, J.K., Grahn, H., Isberg, A.: Using speculation to enhance javascript performance in web applications. IEEE Internet Computing 17(2), 10â19, 3 (2013)
Pan, Z., Eigenmann, R.: Fast and effective orchestration of compiler optimizations for automatic performance tuning. In: CGO 2006. ACM (2006)
Pekhimenko, G., Brown, A.D.: Efficient program compilation through machine learning techniques. Software Automatic Tuning: From Concepts to State-of-the-Art Results, 335 (2010)
Richards, G., Gal, A., Eich, B., Vitek, J.: Automated construction of javascript benchmarks. In: OOPSLA 2011. ACM (2011)
Tilkov, S., Vinoski, S.: Node.js: Using JavaScript to Build High-Performance Network Programs. IEEE Internet Computing 14(6), 80â83 (2010)
Tillmann, N., Moskal, M., de Halleux, J., Fahndrich, M.: TouchDevelop: Programming cloud-connected mobile devices via touchscreen. In: ONWARD 2011. ACM (2011)
Zakai, A.: Emscripten: An LLVM-to-JavaScript compiler. In: SPLASH 2011. ACM (2011)
Zhu, Y., Reddi, V.J.: High-performance and energy-efficient mobile web browsing on big/little systems. In: HPCA 2013. IEEE (2013)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Auler, R., Borin, E., de Halleux, P., Moskal, M., Tillmann, N. (2014). Addressing JavaScript JIT Engines Performance Quirks: A Crowdsourced Adaptive Compiler. In: Cohen, A. (eds) Compiler Construction. CC 2014. Lecture Notes in Computer Science, vol 8409. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-54807-9_13
Download citation
DOI: https://doi.org/10.1007/978-3-642-54807-9_13
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-54806-2
Online ISBN: 978-3-642-54807-9
eBook Packages: Computer ScienceComputer Science (R0)