demo · v135
p50 vs p95 from one PerformanceObserver
Chrome 135 surfaces enough info in PerformanceObserver to spot bimodal distributions — the kind where cold-start outliers swamp the median if you only report the mean. Click "run benchmark" to sample 200 frames; we synthesise a bimodal load to make the split visible.
PerformanceObserver: ?
mean
—p50
—p95
—cold:warm ratio
—the code
const samples = [];
new PerformanceObserver((list) => {
for (const e of list.getEntries()) samples.push(e.duration);
}).observe({ type: "event", buffered: true });
// after capture
samples.sort((a,b) => a - b);
const p = (q) => samples[Math.floor(samples.length * q)];
console.log({ mean: avg(samples), p50: p(0.5), p95: p(0.95) });
// If p95 >> p50, you have a bimodal distribution.
see also
- Bimodal Performance Timings — feature index
- ChromeStatus entry
- Performance Timeline spec