cloudflare / cloudflare/workerd

Another slow(er) throw performance case

Open
#5,341 3 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

Even after applying the `SetCaptureStackTraceForUncaughtExceptions` fix from https://github.com/cloudflare/workerd/issues/5332 I'm still seeing some disparity with Node.js when dealing with thrown objects.

Here's a reproduction:

https://github.com/mhart/throw-microbench

The results from there:

workerd:

```
{ totalTime: 44.74, throwTime: 41.74 }
{ totalTime: 44.75, throwTime: 41.73 }
{ totalTime: 44.75, throwTime: 41.73 }
{ totalTime: 44.74, throwTime: 41.73 }
```

node:

```
{ totalTime: 7.49, throwTime: 5.26 }
{ totalTime: 7.49, throwTime: 5.26 }
{ totalTime: 7.49, throwTime: 5.26 }
{ totalTime: 7.49, throwTime: 5.26 }
```

I'm wondering if it's exacerbated by tasks running over `queueMicrotask` – ie, are the call stacks being constructed across `queueMicrotask` boundaries on workerd, but not on node? And if so, is this (another) v8 setting/config somewhere?

(note there are only 100 `queueMicrotask` calls in the benchmark)

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.