Turbocall: Just-in-time compiler for Deno FFI

Knowledge3months agoupdate AIWindVane
14 0

Turbocall: Just-in-time compiler for Deno FFI

Turbocall: Just-in-time compiler for Deno FFI

Content introduction

In the blog post “Turbocall: A Just-In-Time Compiler for Deno FFI” written by littledivy, a striking optimization in the Deno runtime is revealed. The article takes a deep dive into how Deno leverages a just-in-time (JIT) compiler called Turbocall to accelerate Foreign Function Interface (FFI) calls. This compiler, written in Rust, generates optimized FFI call bindings based on the type information provided, resulting in significant performance improvements – FFI calls in Deno are faster when benchmarked against other runtimes such as Bun and Node.js 100 times. The author littledivy is not only very knowledgeable, but has spoken on this topic at the DenoFest Meetup in Tokyo, showing a deep understanding of the subject. The article highlights how Turbocall bypasses V8’s traditional type checking and protections, allowing direct calls from optimized JIT code. This is a significant departure from normal practice and may have significant implications for developers working with Deno and FFI. This article is a must-read for those interested in the technical advancements of JavaScript runtimes and the future of FFI optimization. It also heralds the potential of future developments, such as Static Hermes and `just-js/lo`, which could further change the landscape of JIT compilation in JavaScript engines.

Automatic summary

– V8 Isolates is a sandbox for running JS and can call local functions through FFI.
– V8 Fast calls are an optimization in V8 that enables calling native bindings directly from optimized JIT code.
– Deno FFI is one of the common scenarios for using V8 Fast calls in Deno.
– Turbocall is a small assembler in Deno for generating optimized FFI call bindings based on type information.
– Turbocall makes FFI calls in Deno 100x faster.
– The implementation details of Turbocall can be learned in the speech at DenoFest Meetup.
– Performance of Turbocall compared to other JS runtimes.
– Static Hermes and just-js/lo are engines that may compete with V8 Fast calls in the future.
– The document provides the author’s Twitter and PDF links.

Original link: https://divy.work/turbocall.html

© Copyright notes

Related posts

No comments

No comments...