Look Before You Leap: Checking in on Type Tag Checking

📅 2026-06-03
📈 Citations: 0
Influential: 0
📄 PDF

career value

154K/year
🤖 AI Summary
This study addresses the lack of systematic evaluation of performance trade-offs associated with type-tagging mechanisms in dynamic languages and symbolic computation systems on modern hardware. Through cross-platform microbenchmarks on AArch64 and x86-64 architectures, the authors compare badged object headers, low-bit tagging, and two NaN-boxing layouts, carefully isolating heap allocation effects from tag-fetching pathways. The work revises conventional assumptions about value representation and type tagging by quantifying the real-world overheads and benefits of each strategy. Findings indicate that low-bit tagging is typically the fastest and most compact for symbolic computation workloads, while NaN-boxing incurs comparable access overhead yet substantially reduces both time and space costs of heap allocation for floating-point values.
📝 Abstract
Tagging of generic dynamic values is important in symbolic-computation and dynamic-language systems, but the trade-offs change as machine architectures and workloads evolve. In particular, old folklore about boxed values, immediate values, and type tags must be recalibrated from time to time. We revisit the performance of badged object headers, low-bit tagging, and two NaN-boxing layouts on a range of platforms in use today, including AArch64 and x86-64 architectures from different manufacturers. The experiments isolate two distinct effects: the cost avoided by not heap-allocating common scalar values, and the cost avoided by obtaining tag information from the value word rather than by performing a heap read. The results show that several local bit operations are often cheaper than opening a heap object to obtain a tag or small value. Low-bit tagging remains the simplest and usually fastest choice for mostly symbolic workloads, while NaN-boxing is close in access cost and avoids the time and space of heap allocation for ordinary floating-point values.
Problem

Research questions and friction points this paper is trying to address.

type tagging
dynamic languages
symbolic computation
NaN-boxing
low-bit tagging
Innovation

Methods, ideas, or system contributions that make the work stand out.

type tagging
NaN-boxing
low-bit tagging
dynamic languages
memory allocation
🔎 Similar Papers