Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::ScriptBytecodeCacheStats Struct Reference

Process-wide reuse of compiled script bytecode (QuickJS backend). More...

#include <js_engine.hpp>

Public Attributes

std::uint64_t compiles = 0
 scripts compiled and stored
std::uint64_t hits = 0
 evaluations served from stored bytecode
std::uint64_t bypassed = 0
 too small to cache, or cache disabled
std::uint64_t precompiled = 0
 of compiles, done by precompile_scripts()
std::uint64_t waits = 0
 evaluations that waited for an in-flight compile
std::uint64_t embedded = 0
 misses served from build-time bytecode, not compiled
std::size_t entries = 0
std::size_t bytes = 0
 bytecode + key bytes held

Detailed Description

Process-wide reuse of compiled script bytecode (QuickJS backend).

The first realm that evaluates a whole script of a few KB or more (a bundled UI runtime, a prelude, a document's inline script) compiles it and keeps the bytecode; every later realm in the same process that evaluates byte-identical source reads the bytecode back instead of parsing again. Keyed by the full source text, so a hit is never a different script. Process-local and in-memory only: bytecode is never written to or read from disk, because QuickJS does not validate untrusted bytecode. The one other source is bytecode compiled at build time and embedded in the product binary itself (see register_embedded_script_bytecode()), which is covered by the binary's own code signature. PULP_JS_BYTECODE_CACHE=0 disables it.

Member Data Documentation

◆ bypassed

std::uint64_t pulp::view::ScriptBytecodeCacheStats::bypassed = 0

too small to cache, or cache disabled

◆ bytes

std::size_t pulp::view::ScriptBytecodeCacheStats::bytes = 0

bytecode + key bytes held

◆ compiles

std::uint64_t pulp::view::ScriptBytecodeCacheStats::compiles = 0

scripts compiled and stored

◆ embedded

std::uint64_t pulp::view::ScriptBytecodeCacheStats::embedded = 0

misses served from build-time bytecode, not compiled

◆ entries

std::size_t pulp::view::ScriptBytecodeCacheStats::entries = 0

◆ hits

std::uint64_t pulp::view::ScriptBytecodeCacheStats::hits = 0

evaluations served from stored bytecode

◆ precompiled

std::uint64_t pulp::view::ScriptBytecodeCacheStats::precompiled = 0

◆ waits

std::uint64_t pulp::view::ScriptBytecodeCacheStats::waits = 0

evaluations that waited for an in-flight compile


The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/view/include/pulp/view/js_engine.hpp