Repository navigation
quickjs-oxide v0.3.1
quickjs-oxide 0.3.1
Compilation takes time linear in the size of the source, code compiled at run time is reclaimed, and peak memory is lower.
Compilation
The handler table is built in one pass, name lookups use indexes, and source positions are located in one forward pass. Compile throughput on a 4 MB source rises from 1.03 to 5.46 MB/s (mixed syntax) and from 5.49 to 6.80 MB/s (many functions); QuickJS 2026-06-04 compiles the same sources at 0.40 and 0.62 MB/s.
Memory
- Code compiled at run time (
eval, theFunctionconstructors, modules loaded while the program runs) is freed with its inline caches, atoms and RegExp programs once nothing refers to it. It counts toward the heap cap. - The collector budgets the heap at
max(min_heap, (1 + growth) × live), arenas allocate from bitmaps, the value heap coalesces freed ranges, and arrays and constant tables take3 × 2^ksizes. - On Linux x86_64 the
qjsfunctions that startup and the common paths run are linked together.
Peak RSS on the fixed-work programs, geometric mean against QuickJS 2026-06-04: 1.59×, from 1.96× before the heap changes (#161). An empty script takes 3.9 MiB, from 4.8 MiB (QuickJS 3.2 MiB). Fixed-work CodeLoad, which compiles code at run time, peaks at 35.8 MiB instead of 122.3 MiB before #156.
Embedding API
Runtime::transient_compiler(),EvalOptions::transient()andCompileOptions::transient()compile code that is freed likeeval's, such as a REPL's lines.Runtime::compiler()keeps compiled code for the life of the runtime.MemoryReportsplits static and dynamic code units and reports dynamic code bytes, RegExp program bytes, free cache entries, pinned atoms and the heap budget.
Install qjs
Prebuilt binaries for Linux (static musl), macOS and Windows are attached below.
# Prebuilt binary through cargo-binstall
cargo binstall --git https://github.com/pocket-nexus/quickjs-oxide quickjs-oxide-cli
# Build from source (Rust 1.99 or newer)
cargo install --locked --git https://github.com/pocket-nexus/quickjs-oxide --tag v0.3.1 quickjs-oxide-cliWebAssembly
quickjs-oxide-wasm-v0.3.1.tar.gz: wasm-bindgen packages for browsers (web/, ES module) and Node.js (nodejs/).quickjs-oxide-playground-v0.3.1.tar.gz: the static playground site for this release, also served at https://pocket-nexus.github.io/quickjs-oxide/releases/v0.3.1/.
SHA256SUMS lists the digest of every attached file.
What's Changed
- Build the compile probe without the removed feature list by @Eric-Song-Nop in #153
- Compile in linear time: one-pass handler table, indexed names, fewer passes and allocations (#154, #155) by @Eric-Song-Nop in #160
- Reclaim code compiled at run time, its caches and its atoms (#156) by @Eric-Song-Nop in #159
- Lower peak memory: link order, a reserved-bytes budget, bitmap arenas, a coalescing value heap, smaller arrays by @Eric-Song-Nop in #161
Full Changelog: v0.3.0...v0.3.1