Julia中的类型稳定性:避免JIT编译中的性能病态(扩展版)
Type Stability in Julia: Avoiding Performance Pathologies in JIT Compilation (Extended Version)
摘要:
作为一种科学的程序设计语言,Julia在追求性能的同时也提供了高水平的生产力特性。为了避免性能问题,Julia用户应该遵守一个编码规则,以实现所谓的类型稳定性。非正式地说,如果输出的类型仅取决于输入的类型,而不是它们的值,则函数是类型稳定的。本文给出了类型稳定性的形式化定义以及类型可扩展性的一个更强的性质,说明了可扩展性使编译器能够进行优化,并证明了编译器的正确性。我们还进行了语料库分析,以揭示这些类型相关的属性在实践中的表现。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。