Skip to main navigation Skip to search Skip to main content

Tail Call Optimization Tailored for Native Stack Utilization in JavaScript Runtimes

  • Hyukwoo Park*
  • , Seonghyun Kim
  • *Corresponding author for this work
  • Samsung

Research output: Contribution to journalJournal articlepeer-review

Abstract

JavaScript has significantly evolved, broadening its capabilities. However, the uptake of tail call optimization (TCO) remains limited, largely due to concerns about debugging difficulties and the potential increase in overall complexity. This paper highlights the compelling importance of tail calls within web applications, advocating for TCO as a means to boost performance and enhance memory efficiency. We present an innovative TCO technique that leverages the native stack within JavaScript engines, capitalizing on the native stack's inherent benefits over heap memory. This technique is carefully crafted to comply with diverse TCO standards, prioritizing simplicity and providing debugging features. We tackle the inherent challenges of TCO and successfully deploy our method in a lightweight JavaScript engine. Our approach is rigorously evaluated, proving its effectiveness and practicality. Notably, our implementation facilitates considerable memory savings for web applications, comparable to the maximum Resident Set Size (RSS), and achieves an average performance improvement of approximately 19.8% for algorithms that are heavily recursive. This research not only demonstrates the versatility and efficiency of our TCO strategy but also makes a significant contribution to the wider adoption and comprehension of TCO, thereby improving JavaScript engines' performance and memory management efficiency.

Original languageEnglish
Pages (from-to)111801-111817
Number of pages17
JournalIEEE Access
Volume12
DOIs
StatePublished - 2024

Keywords

  • Code optimization
  • JavaScript
  • JavaScript engine
  • compiler
  • interpreter
  • tail call optimization

Fingerprint

Dive into the research topics of 'Tail Call Optimization Tailored for Native Stack Utilization in JavaScript Runtimes'. Together they form a unique fingerprint.

Cite this