Commit 29a3c84
authored
feat: Early load ustr (#792)
## Problem
The first time `Ustr::from()` is called, it takes 10+ ms to init. Right
now this is on the critical path and adds to cold start time.
## This PR
Start it early in a separate thread, so when it is needed later, it will
be already initialized.
## Result
Using `extensiononly` stack on Node 22:
### Before
- `Datadog Next-Gen Extension ready in`: **57.2** ±3.1 ms (95%
confidence interval, 17 data points)
- `Metrics aggregator created in`: **10+ ms** (10,000+ us)
### After
- `Datadog Next-Gen Extension ready in`: **49.7**±1.9 ms (95% confidence
level, 10 data points)
- `Metrics aggregator created in`: **277±186 us** (95% confidence level,
10 data points)
Thanks @duncanista for identifying this performance bottleneck!
Jira: https://datadoghq.atlassian.net/browse/SVLS-74561 parent 483ef3b commit 29a3c84
3 files changed
Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
| 335 | + | |
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
| |||
382 | 384 | | |
383 | 385 | | |
384 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
385 | 395 | | |
386 | 396 | | |
387 | 397 | | |
| |||
479 | 489 | | |
480 | 490 | | |
481 | 491 | | |
| 492 | + | |
482 | 493 | | |
483 | 494 | | |
484 | 495 | | |
485 | 496 | | |
486 | 497 | | |
487 | 498 | | |
488 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
489 | 507 | | |
490 | 508 | | |
491 | 509 | | |
| |||
0 commit comments