optimize

open suspend override fun optimize(bytes: ByteArray, optLevel: OptLevel): ByteArray

Optimize bytes at optLevel, returning a distinct, still-runnable, ABI-preserving module. The result's content hash differs from the source (unless optLevel is a passthrough), making it a genuinely distinct, fetchable variant.

Suspending because production implementations perform blocking I/O (extract and exec a bundled wasm-opt binary) that must run off the caller's thread.