דלג לתוכן (מקש קיצור 's')
אירועים

אירועים והרצאות בפקולטה למדעי המחשב ע"ש הנרי ומרילין טאוב

אופטימיזציה לתכניות בעלות טיפוסיות דינמית באמצעות הידור מקדים וניתוח סטטי
event speaker icon
עדי חריף (הרצאה סמינריונית למגיסטר)
event date icon
יום שני, 26.05.2025, 11:30
event location icon
טאוב 301
event speaker icon
מנחה: Prof. Shachar Itzhaky

The software landscape is showing consistent, accelerated growth in the volume of code developed using dynamic languages. These languages are characterized by dynamic typing and more lax preemptive checks, which allow rapid application development and shorter development cycles. The vast majority of these languages are interpreted; that is, programs are executed by an interpreter in a managed runtime environment. Such interpreters incur significant performance hits, and, to counter that, modern runtime environments usually employ some sort of optimization. The most common one is Just-in-Time compilation (JIT), which translates source code on-demand into native code that can run much faster. Some notable JIT engines (such as V8 for JavaScript) exhibit impressive speedups. Still, in most realistic scenarios, they cannot surpass the performance of hand-crafted native code written in a low-level language like C.

There are inherent reasons for why Ahead-of-Time compilation (AOT) is rarely practiced with dynamic languages. Since variables are dynamically typed, this will require most of the type-checking to be done at runtime still, thus limiting the range of optimization that can be performed ahead of time, consequently limiting the benefit of AOT compilation. We propose an approach that utilizes static analysis for the purpose of sound type inference, which can then be leveraged for code generation requiring minimal amount of runtime type checks. Unlike previous work in this area, our approach eliminates the need for the JIT at runtime, or, indeed, any managed runtime at all. We claim that real-world JavaScript applications can, in fact, benefit much from using AOT, in terms of increased speed. We show empirical evidence on a set of representative benchmarks supports this claim.