ABSTRACT
Property caches are a well-known technique invented over 30 years ago to improve dynamic object accesses. They have been adapted to JavaScript, which they have greatly contributed to accelerate. However, this technique is applicable only when some constraints are satisfied by the objects, the properties, and the property access sites. In this work, we propose enhancements to improve two common usage patterns: prototype accesses and megamorphic accesses. We have implemented these in the Hopc AOT JavaScript compiler and we have measured their impact. We observe that they effectively complement traditional caches. They reduce cache misses and consequently accelerate execution. Moreover, they do not cause a slowdown in the handling of the other usage patterns.
- R. Artoul. 2015.Google Scholar
- Javascript Hidden Classes and Inline Caching in V8. http:// richardartoul.github.io/jekyll/update/2015/04/26/hidden-classes.html. (April 2015). D. Bevenius. 2018. Learning Google V8. https://github.com/danbev/learning-v8. (2018).Google Scholar
- C. F. Bolz, L. Diekmann, and L. Tratt. 2013. Storage Strategies for Collections in Dynamically Typed Languages. In ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications. 167–182. C. Bruni. 2017. Google ScholarDigital Library
- Standard ECMA-262 - ECMAScript Language Specification (5.1 ed.). http://www.ecma-international.org/publications/standards/Ecma-262.htm ECMA International. 2015.Google Scholar
- Standard ECMA-262 - ECMAScript Language Specification (6.0 ed.). http://www.ecma-international.org/ecma-262/6.0/ A. Gal and et al. 2009. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2009, Dublin, Ireland, June 15-21, 2009. Google ScholarDigital Library
- 465–478. L. Gong, M. Pradel, and K. Sen. 2014.Google Scholar
- JITPROF: Pinpointing JIT-unfriendly JavaScript Code. Technical Report UCB/EECS-2014-144. Liang Gong, Michael Pradel, and Koushik Sen. 2015. JITProf: Pinpointing JIT-unfriendly JavaScript Code. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015). ACM, New York, NY, USA, 357–368. Google ScholarDigital Library
- A. Hass and et al. 2017. Bringing the Web Up to Speed with WebAssembly. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). ACM, USA, 185–200. U. Hölzle, C. Chambers, and D. Ungar. 1991. Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP ’91). UK, 21–38. Microsoft. 2018. Chakra. https://github.com/Microsoft/ChakraCore/wiki/Resources. (2018). Google ScholarDigital Library
- P. Ratanaworabhan, B. Livshits, and B. G. Zorn. 2010. JSMeter: Comparing the Behavior of JavaScript Benchmarks with Real Web Applications. In Proceedings of the 2010 USENIX Conference on Web Application Development (WebApps’10). USA, 12. F. Schneider. 2012. High JavaSscript performance with V8. http://cs.au.dk/~jmi/VM/ IC-V8.pdf. (March 2012). M. Serrano. 2018. JavaScript AOT Compilation. In 14th Dynamic Language Symposium (DLS). Boston, USA. Google ScholarDigital Library
- Design Elements. https://github.com/v8/v8/wiki/Design% 20Elements. (Nov. 2015). Henry S. Warren. 2002.Google Scholar
Index Terms
- Property caches revisited
Recommendations
Dynamic property caches: a step towards faster JavaScript proxy objects
CC 2020: Proceedings of the 29th International Conference on Compiler ConstructionInline caches and hidden classes are two essential components for closing the performance gap between static languages such as Java, Scheme, or ML and dynamic languages such as JavaScript or Python. They rely on the observation that for a particular ...
Performance of One's Complement Caches
On-chip caches to reduce average memory access latency are commonplace in today's commercial microprocessors. These on-chip caches generally have low associativity and small cache sizes. Cache line conflicts are the main source of cache misses, which ...
Comments