function
jsc.bytecodeOrderStats
For an executable built with bun build --compile --bytecode --bytecode-order: how many functions this thread has loaded from each part of the bytecode the order file arranged. Returns null in any other process. See BytecodeOrderStats.
import { bytecodeOrderStats } from "bun:jsc";
const stats = bytecodeOrderStats();
if (stats) console.log(stats.cold / (stats.hot + stats.unknown + stats.cold));Referenced types
interface BytecodeOrderStats
Returned by bytecodeOrderStats. Counts are per thread: a Worker has its own. A function whose bytecode was discarded and loaded again counts again. Sizes are in bytes.
- regions: { cold: number; expressionInfo: number; hot: number; lateModuleHeads: number; moduleHeads: number; unknown: number }
The size of each part of the bytecode, in the order they are stored.