Skip to content

Reduce 2.2s WASM compilation stall on startup #111

Description

@ysdede

Trace: Trace-20260213T014231.json (summary in trace_analysis_summary.json)

Evidence

  • wasm compilation spike: 2198.78ms ThreadPool_RunTask (v8.wasm TopTierCompilation) on TID 6656
  • additional 334ms and 201ms compilation tasks on other threadpool workers

Impact

  • Large startup stall before first inference; likely felt as initial UI freeze or delayed transcription start.

Hypothesis

  • WASM modules (TEN-VAD, model runtime, or preprocessor) are compiling on-demand during first use.

Actions

  • Pre-warm WASM compilation after user gesture (load screen) using WebAssembly.compileStreaming/instantiateStreaming.
  • Defer heavy modules until after UI is responsive; optionally show warmup progress.
  • Verify whether parakeet.js or TEN-VAD has a cache warming API; enable if available.

Acceptance

  • No single wasm.TopTierCompilation task >500ms on first recording start.
  • Time-to-first-transcript improves measurably vs this trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance optimization and profilingpriority:criticalMust-fix regressions, leaks, or major UX/perf blockers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions