Type stability in Julia: avoiding performance pathologies in JIT compilation
Open Access
- 15 October 2021
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 5 (OOPSLA) , 1-26
Abstract
As a scientific programming language, Julia strives for performance but also provides high-level productivity features. To avoid performance pathologies, Julia users are expected to adhere to a coding discipline that enables so-called type stability. Informally, a function is type stable if the type of the output depends only on the types of the inputs, not their values. This paper provides a formal definition of type stability as well as a stronger property of type groundedness, shows that groundedness enables compiler optimizations, and proves the compiler correct. We also perform a corpus analysis to uncover how these type-related properties manifest in practice.Keywords
All Related Versions
Funding Information
- European Research Council (695412)
- Czech Ministry of Education (CZ.02.1.01/0.0/0.0/15_003/0000421)
- Office of Naval Research (503353)
- National Science Foundation (1759736,1925644,1618732,CCF-1909143,CCF-1908389)
This publication has 25 references indexed in Scilit:
- Julia: A Fresh Approach to Numerical ComputingSIAM Review, 2017
- An intermediate representation for speculative optimizations in a dynamic compiler2013
- Self-optimizing AST interpreters2012
- RATA: Rapid Atomic Type Analysis by Abstract Interpretation – Application to JavaScript OptimizationLecture Notes in Computer Science, 2010
- Trace-based just-in-time type specialization for dynamic languagesACM SIGPLAN Notices, 2009
- Eliminating virtual function calls in C++ programs1996
- Optimizing dynamically-dispatched calls with run-time type feedback1994
- Customization: optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language1989
- Hurricane: an optimizing compiler for SmalltalkACM SIGPLAN Notices, 1986
- Efficient implementation of the smalltalk-80 system1984