dd-trace-php
dd-trace-php copied to clipboard
feat(profiling) allocation profiling for PHP ZTS
Description
PROF-8922 / #2070
This PR will bring allocation profiling to ZTS versions of PHP. In the "there is another custom handler installed" code path we are using an UnsafeCell for a thread local which is the cheapest way (evaluated at compile time and not runtime), as this is in the hot path (every allocation and free would borrow check at runtime).
We could argue that the case of another extension that has custom handlers installed is nearly non existing, so we could also be better safe then sorry, but OTOH I could not get it to crash.
Reviewer checklist
- [x] Test coverage seems ok.
- [x] Appropriate labels assigned.
Benchmarks
Benchmark execution time: 2024-03-20 11:33:38
Comparing candidate commit 81fa090402588f3fc23466b43113434a76110383 in PR branch florian/allocation-zts with baseline commit 7c36868d5a4095da371c74080234d630a95e2bc6 in branch master.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 3 unstable metrics.
Codecov Report
Merging #2506 (f7b21b0) into master (fc050ce) will increase coverage by
1.16%. Report is 5 commits behind head on master. The diff coverage isn/a.
Additional details and impacted files
@@ Coverage Diff @@
## master #2506 +/- ##
============================================
+ Coverage 75.91% 77.07% +1.16%
Complexity 2563 2563
============================================
Files 241 215 -26
Lines 27020 23048 -3972
Branches 976 0 -976
============================================
- Hits 20511 17765 -2746
+ Misses 5989 5283 -706
+ Partials 520 0 -520
| Flag | Coverage Δ | |
|---|---|---|
| appsec-extension | ? |
|
| tracer-extension | 78.70% <ø> (ø) |
|
| tracer-php | 75.06% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
see 26 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update fc050ce...f7b21b0. Read the comment docs.