Problem
The 6.5 MB WASM binary starts downloading only after JS hydration on the /playground page, delaying interactive time significantly. The load waterfall is:
- Page hydrates → JS evaluates →
initWasm() called
loadScript("/wasm/wasm_exec.js") fetched (sequential)
fetch("/wasm/gosqlx.wasm") — 6.2 MB (sequential, no preload)
WebAssembly.instantiate() called
This makes the playground unusable for several seconds on first load, especially on mobile.
Fix
Add to the playground page: <link rel='preload' as='fetch' href='/wasm/gosqlx.wasm' crossOrigin='anonymous'> — this starts the WASM download in parallel with JS execution, cutting time-to-interactive by 1–3 seconds on fast connections and 5–15 seconds on mobile.
Problem
The 6.5 MB WASM binary starts downloading only after JS hydration on the /playground page, delaying interactive time significantly. The load waterfall is:
initWasm()calledloadScript("/wasm/wasm_exec.js")fetched (sequential)fetch("/wasm/gosqlx.wasm")— 6.2 MB (sequential, no preload)WebAssembly.instantiate()calledThis makes the playground unusable for several seconds on first load, especially on mobile.
Fix
Add to the playground page:
<link rel='preload' as='fetch' href='/wasm/gosqlx.wasm' crossOrigin='anonymous'>— this starts the WASM download in parallel with JS execution, cutting time-to-interactive by 1–3 seconds on fast connections and 5–15 seconds on mobile.