Commit 525555b
committed
fix(debugger): reuse loaded tracer for trace context in devtools client
The devtools worker evaluates an expression on every paused call frame to read
the active trace and span IDs. That expression used global.require('dd-trace'),
which re-resolves and re-requires the tracer module on each hit.
Use globalThis._ddtrace instead, matching the singleton instance installed by
bootstrap when the application first loads dd-trace. This avoids duplicate
module resolution, works when the bare 'dd-trace' specifier is not resolvable
from the paused frame (e.g. sirun benchmarks that load the tracer by path), and
removes per-hit require overhead from the hot pause path.1 parent 6267703 commit 525555b
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments