QuickJS
By Fabrice Bellard
QuickJS is a small, embeddable JavaScript engine created by Fabrice Bellard, designed to implement the ECMAScript specification in a compact codebase that can be included in resource-constrained applications without the memory or…
Definition
QuickJS is a small, embeddable JavaScript engine created by Fabrice Bellard, designed to implement the ECMAScript specification in a compact codebase that can be included in resource-constrained applications without the memory or binary-size footprint of larger engines like V8. It compiles JavaScript to bytecode and interprets it, prioritizing footprint and startup speed over peak JIT-compiled throughput, and it is distributed as a permissively licensed open-source project.
Overview
QuickJS was built to address a gap left by engines like V8, SpiderMonkey, and JavaScriptCore: those engines deliver excellent peak performance but come with large codebases, substantial binary sizes, and nontrivial embedding complexity, which makes them impractical for many embedded, IoT, or lightweight scripting use cases. QuickJS instead targets small size and fast startup as its primary design goals, accepting lower peak execution speed on long, hot loops in exchange. Mechanically, QuickJS compiles JavaScript source into a compact bytecode format and executes that bytecode with an interpreter, without the multi-tier JIT compilation pipelines that dominate browser engines. This keeps its implementation small, commonly cited as compiling down to a binary far smaller than the megabytes typical of a full JIT engine, and lets it start executing scripts almost immediately without JIT warm-up delay. It aims for high conformance with the ECMAScript specification despite its small size, including support for modules, async functions, and generators. Among JavaScript engines, QuickJS occupies a different point on the size-versus-speed spectrum than V8, SpiderMonkey, or Hermes: where those engines invest heavily in JIT compilation for raw throughput, QuickJS is closer in philosophy to a pure bytecode interpreter, similar to how a scripting language engine, rather than a browser engine, might be designed. It shares this trade-off broadly with engines built for embedded or command-line tool contexts rather than complex web applications. In practice, QuickJS is used to embed JavaScript scripting capability inside applications, tools, and games where a small footprint and quick startup matter more than executing large, hot loops as fast as possible, and it has also been used as a fast standalone JavaScript command-line interpreter and in build tooling that needs to run small scripts quickly without engine overhead. The main limitation is peak execution speed on long-running, computation-heavy JavaScript, where JIT-compiling engines like V8 substantially outperform a pure bytecode interpreter over time, since QuickJS never recompiles hot paths into native machine code. Its smaller contributor base and narrower production track record than the major browser engines also mean fewer battle-tested edge cases have been exercised at scale. Projects with sustained CPU-bound JavaScript workloads generally still reach for a JIT engine, reserving QuickJS for cases where binary size, startup latency, or embedding simplicity are the dominant constraints rather than raw computational throughput. Debugging tooling around QuickJS is also less mature than the developer tools bundled with major browser engines, so teams embedding it often build lightweight custom logging or tracing around their integration instead.
Key Features
- Small, compact codebase suited for embedded and constrained environments
- Compiles JavaScript to bytecode and interprets it without a JIT tier
- Fast startup with no JIT warm-up delay
- High conformance with the ECMAScript specification despite small size
- Supports modules, async functions, and generators
- Easily embeddable in C and C++ applications
- Also usable as a standalone command-line JavaScript interpreter
- Small binary footprint compared to full JIT-based engines