Sampling Optimized Code for Type Feedback
Olivier Fl\"uckiger, Andreas W\"alchli, Sebasti\'an Krynski and, Jan Vitek

TL;DR
This paper introduces a sampling-based profiling method for JIT compilers that detects stale type feedback in dynamically typed languages, enabling timely recompilation for optimized performance with minimal overhead.
Contribution
It proposes a novel sampling profiler for native code that detects stale type feedback in JIT-compiled code without instrumentation overhead.
Findings
Sampling profiler detects stale type feedback within milliseconds.
Overhead of sampling profiler is less than 3% in most cases.
Method effectively triggers recompilation for more specific types.
Abstract
To efficiently execute dynamically typed languages, many language implementations have adopted a two-tier architecture. The first tier aims for low-latency startup times and collects dynamic profiles, such as the dynamic types of variables. The second tier provides high-throughput using an optimizing compiler that specializes code to the recorded type information. If the program behavior changes to the point that not previously seen types occur in specialized code, that specialized code becomes invalid, it is deoptimized, and control is transferred back to the first tier execution engine which will start specializing anew. However, if the program behavior becomes more specific, for instance, if a polymorphic variable becomes monomorphic, nothing changes. Once the program is running optimized code, there are no means to notice that an opportunity for optimization has been missed. We…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
