Abstract
Web applications have been gaining huge popularity due to being platform independent and also enabling fast development. Unfortunately, due to insufficient performance of web applications, they are generally limited to non-performance-critical use. The performance of web applications is largely affected by the performance of JavaScript. To address this problem, modern JavaScript engines such as Google’s V8 incorporate many state-of-the-art optimization and engineering techniques. In industry, recent approaches are to extend JavaScript to decorate objects with types to better utilize just-in-time (JIT) compilers.
In this paper, we present Typed JS, a subset of JavaScript that utilizes type-decorated syntax. Unlike previous approaches, Typed JS supports most of the JS core operations while utilizing the ahead-of-time (AOT) compilation technique, which was not possible in the existing solution. Typed JS is specifically designed for running Web applications on mobile devices with goals of having smaller memory footprint while achieving high-performance, which is accomplished by utilizing the type information and AOT technique. Experiments show that Typed JS requires significantly much less memory usage while performing better than industry-leading JavaScript engines on a mobile platform.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
References
Ahn, W., Choi, J., Shull, T., Garzarán, M.J., Torrellas, J.: Improving javascript performance by deconstructing the type system. In: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, p. 51. ACM, Edinburgh, United Kingdom, June 2014
Apple.Javascriptcore (2005). http://trac.webkit.org/wiki/JavaScriptCore
Böhm, I., von Koch, T.J.K.E., Kyle, S.C., Franke, B., Topham, N.P.: Generalized just-in-time trace compilation using a parallel task farm in a dynamic binary translator. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 74–85. ACM, San Jose, CA, June 2011
Bolz, C.F., Cuni, A., Fijalkowski, M., Rigo, A.: Tracing the meta-level: Pypy’s tracing JIT compiler. In: Proceedings of the 4th Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, pp. 18–25. ACM, Genova, Italy (2009)
Bracha, G., Griswold, D.: Strongtalk: typechecking smalltalk in a production environment. In: Proceedings of the Eighth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pp. 215–230. ACM, Washington, DC, October 1993
Chambers, C., Ungar, D., Lee, E.: An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes. Lisp Symb. Comput. 4(3), 243–281 (1991)
Choi, P.W., Chandra, S., Necula, G., Sen, K.: SJS: a typed subset of javascript with fixed object layout. Technical report UCB/EECS-2015-10, EECS Department, University of California, Berkeley, March 2015
Facebook.flow (2014). http://flowtype.org/
Google.Chrome v8 (2008). https://developers.google.com/v8/
Google.NaCl and PNaCl (2013). https://developer.chrome.com/native-client/nacl-and-pnacl/
Hölzle, U., Chambers, C., Ungar, D.: Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In: Proceedings of European Conference on Object-Oriented Programming, pp. 21–38. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Geneva, Switzerland, July 1991
Hölzle, U., Chambers, C., Ungar, D.: Debugging optimized code with dynamic deoptimization. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 32–43. ACM, San Francisco CA, June 1992
IBM.Wala (2006). https://wala.sourceforge.net
Microsoft.TypeScript (2012). http://www.typescriptlang.org/
Mozilla.asm.js (2013). http://asmjs.org/
Rompf, T., Sujeeth, A.K., Brown, K.J., Lee, H., Chafi, H., Olukotun, K.: Surgical precision JIT compilers. In: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, p. 8. ACM, Edinburgh, United Kingdom, June 2014
Vilk, J., Berger, E.D.: Doppio: breaking the browser language barrier. In: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 52. ACM, Edinburgh, United Kingdom, June 2014
Acknowledgment
We thank our group members Junyoung Cho, Eunji Jeong, Saebom Kim, Wonyong Kim, Sanggyu Lee, Seungsoo Lee, Jaeman Park, and Youngsoo Son for their contributions to this paper. We are also grateful to the anonymous reviewers for their constructive comments on this paper.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Institute for Computer Sciences, Social Informatics and Telecommunications Engineering
About this paper
Cite this paper
Choi, R.H., Choi, Y. (2015). Typed JS: A Lightweight Typed JavaScript Engine for Mobile Devices. In: Sigg, S., Nurmi, P., Salim, F. (eds) Mobile Computing, Applications, and Services. MobiCASE 2015. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, vol 162. Springer, Cham. https://doi.org/10.1007/978-3-319-29003-4_7
Download citation
DOI: https://doi.org/10.1007/978-3-319-29003-4_7
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-29002-7
Online ISBN: 978-3-319-29003-4
eBook Packages: Computer ScienceComputer Science (R0)