property

CompileBuildOptions.bytecodeOrder

bytecodeOrder?: null | string | false | string[]

Profile-guided layout for the executable's bytecode. Requires bytecode: true.

Run an executable built with bytecode: true with BUN_BYTECODE_ORDER_OUT=<path> to record which functions it uses, then build again with that file. Bun places the bytecode the run used together at the front, so the executable starts faster and uses less memory. A profile from an older build of the app still applies.

With several files, list the most common way of starting the app first. false and null mean no profile, so bytecodeOrder: haveProfile && path works.

Equivalent CLI flag: --bytecode-order <file>[,<file>...]