Skip to content

Implement runWithContext#275

Open
szegedi wants to merge 1 commit intoszegedi/acf-simplefrom
szegedi/run-with-context
Open

Implement runWithContext#275
szegedi wants to merge 1 commit intoszegedi/acf-simplefrom
szegedi/run-with-context

Conversation

@szegedi
Copy link

@szegedi szegedi commented Feb 16, 2026

What does this PR do?:

  • Also adds a createContextHolder method to the profiler for direct use of custom contexts with AsyncLocalStorage.run()
  • implements a TimeProfiler.runWithContext on top of it.

Motivation:
This can be used by dd-trace-js for implementing custom contexts

How to test the change?:
It comes with unit tests.

@szegedi szegedi requested a review from nsavoire as a code owner February 16, 2026 22:12
@szegedi szegedi added the semver-minor Usually minor non-breaking improvements label Feb 16, 2026
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Overall package size

Self size: 1.81 MB
Deduped: 2.18 MB
No deduping: 2.18 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | pprof-format | 2.2.1 | 163.06 kB | 163.06 kB | | p-limit | 3.1.0 | 7.75 kB | 13.78 kB | | node-gyp-build | 3.9.0 | 8.81 kB | 8.81 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@pr-commenter
Copy link

pr-commenter bot commented Feb 16, 2026

Benchmarks

Benchmark execution time: 2026-02-17 11:30:12

Comparing candidate commit 705e5a3 in PR branch szegedi/run-with-context with baseline commit 889d79f in branch szegedi/acf-simple.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 90 metrics, 29 unstable metrics.

scenario:profiler-light-load-no-wall-profiler-22

  • 🟥 cpu_user_time [+1.737ms; +7.235ms] or [+2.465%; +10.270%]

@szegedi szegedi marked this pull request as draft February 17, 2026 10:32
@szegedi szegedi force-pushed the szegedi/run-with-context branch from 99d1d57 to 21554cd Compare February 17, 2026 10:40
@szegedi szegedi force-pushed the szegedi/run-with-context branch from 21554cd to 705e5a3 Compare February 17, 2026 11:25
@szegedi szegedi marked this pull request as ready for review February 17, 2026 11:28
Copy link

@IlyasShabi IlyasShabi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor Usually minor non-breaking improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants