cloudflare / cloudflare/workerd

🐛 Bug Report — Strange "throw" accounting in chrome dev tools

Open
#5,301 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

I see some strange behaviour with "throw" lines being potentially miscounted in performance profiles. Latest workerd (reports as `workerd 2025-10-11`), on macOS.

These images are from a single request that took about 50ms (while the inspector was attached) – note the figures here are 1.5 and 4.5 secs, which is impossible – so something is either double counting, or not representing time take correctly.

Image

Image

Essentially identical code running in Node.js – it accounts for the throw time correctly:

Image

Code is:

```js
export default {
async fetch() {
for (let i = 0; i < 10_000; i++) {
try {
throwChunk();
} catch {}
}
return new Response();
},
};

function throwChunk() {
throw new Error();
}
```

Running with `workerd` directly, not wrangler/miniflare.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.