Size / Priority
Rationale
V8's built-in profiler is general-purpose. For actor-specific tuning, a focused profiler that samples ActorCell._dispatchOne calls + reports per-actor flame-graphs is more targeted.
Design sketch
// src/profiler/ActorProfiler.ts (new)
export class ActorProfiler {
start(): void;
stop(): ProfilerReport;
}
export interface ProfilerReport {
/** Per-actor handler call counts + duration histogram. */
readonly perActor: ReadonlyMap<string, ActorProfile>;
/** Emit a flamegraph.html file. */
toFlamegraph(): string;
/** Emit Chrome DevTools .cpuprofile. */
toCpuProfile(): unknown;
}
Sample-based profiler hooks into ActorCell.onReceive timing.
Out of scope / non-goals
- Production profiling — dev/staging only (overhead).
- Cross-runtime profiler — Bun differs from Node.
Test plan
- Profile workload; report contains per-actor stats.
- Flame-graph file opens in browser.
- CPU profile loads in Chrome DevTools.
Acceptance criteria
Size / Priority
Rationale
V8's built-in profiler is general-purpose. For actor-specific tuning, a focused profiler that samples
ActorCell._dispatchOnecalls + reports per-actor flame-graphs is more targeted.Design sketch
Sample-based profiler hooks into ActorCell.onReceive timing.
Out of scope / non-goals
Test plan
Acceptance criteria
ActorProfilerclass.