Skip to content

[Profiler] Improve memory consumption LibrariesInfoCache#8777

Merged
andrewlock merged 6 commits into
masterfrom
gleocadie/improve-memory-consumption-librariesinfocache
Jun 15, 2026
Merged

[Profiler] Improve memory consumption LibrariesInfoCache#8777
andrewlock merged 6 commits into
masterfrom
gleocadie/improve-memory-consumption-librariesinfocache

Conversation

@gleocadie

@gleocadie gleocadie commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Improve memory overhead of the LibrariesCacheInfo.

Reason for change

LibrariesCacheInfo component caches ELF symbols to improve stack walking. But this comes at a cost CPU + Memory.

Today (master)

[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997] LibrariesInfoCache stats:
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Cache reloads: 10
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Total CPU (worker): 42 ms
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Libraries in cache: 21
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Module regions: 18
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Symbol entries: 27179
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Memory current: 1410520 bytes

We can see a 42ms CPU usage and 1.4MB memory usage for 27179 symbols. 42ms of CPU over the lifetime of the application is totally negligible, but 1.4MB leaves a mark.

This PR does 2 improvements:

  • Replace std::function Deleters
  • Compact FuncEntry for ARM64

With this PR

[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347] LibrariesInfoCache stats:
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Cache reloads: 13
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Total CPU (worker): 57 ms
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Libraries in cache: 21
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Module regions: 18
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Symbol entries: 27179
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Memory current: 565528 bytes

Implementation details

  • Replace std::unique_ptr<T, std::function<void(void*)>> with a trivial deleter struct PmrDeleter
  • Store function entries relative to their module base:
    Works because: modules are always < 4GB (shared libraries mapped within 32-bit offset range from their base)

Test coverage

Other details

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 10, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 3 Pipeline jobs failed

consolidated-pipeline | Linux   View in Datadog

DataDog/apm-reliability/dd-trace-dotnet | download-serverless-artifacts   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-dotnet | download-single-step-artifacts   View in Datadog   GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 49a2f28 | Docs | Datadog PR Page | Give us feedback!

@github-actions github-actions Bot added the area:profiler Issues related to the continous-profiler label Jun 10, 2026
@gleocadie
gleocadie force-pushed the gleocadie/improve-memory-consumption-librariesinfocache branch from 45ba215 to ce3a404 Compare June 11, 2026 06:57
@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8777) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration73.07 ± (72.97 - 73.45) ms72.46 ± (72.51 - 72.84) ms-0.8%
.NET Framework 4.8 - Bailout
duration76.32 ± (76.05 - 76.43) ms77.30 ± (77.31 - 77.76) ms+1.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1095.39 ± (1091.61 - 1099.04) ms1093.36 ± (1092.64 - 1099.60) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.71 ± (22.65 - 22.77) ms22.49 ± (22.44 - 22.55) ms-0.9%
process.time_to_main_ms84.30 ± (84.04 - 84.56) ms83.83 ± (83.59 - 84.07) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.91 ± (10.91 - 10.91) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.46 ± (22.42 - 22.50) ms22.73 ± (22.67 - 22.79) ms+1.2%✅⬆️
process.time_to_main_ms84.38 ± (84.19 - 84.56) ms87.48 ± (87.16 - 87.80) ms+3.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.93 - 10.94) MB10.93 ± (10.93 - 10.94) MB-0.1%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms215.25 ± (214.40 - 216.10) ms213.38 ± (212.16 - 214.60) ms-0.9%
process.time_to_main_ms540.52 ± (539.23 - 541.81) ms540.43 ± (538.93 - 541.93) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.28 ± (48.25 - 48.31) MB48.38 ± (48.34 - 48.41) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.23 ± (21.17 - 21.28) ms21.36 ± (21.30 - 21.41) ms+0.6%✅⬆️
process.time_to_main_ms72.69 ± (72.47 - 72.91) ms73.70 ± (73.45 - 73.94) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.60 - 10.61) MB10.63 ± (10.62 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.37 ± (21.33 - 21.42) ms21.46 ± (21.40 - 21.51) ms+0.4%✅⬆️
process.time_to_main_ms75.35 ± (75.10 - 75.59) ms75.81 ± (75.55 - 76.08) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.73) MB10.74 ± (10.74 - 10.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms368.14 ± (366.15 - 370.13) ms373.36 ± (371.04 - 375.69) ms+1.4%✅⬆️
process.time_to_main_ms544.48 ± (543.32 - 545.64) ms548.20 ± (546.78 - 549.62) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.76 ± (49.74 - 49.78) MB49.80 ± (49.78 - 49.82) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 8 - Baseline
process.internal_duration_ms19.29 ± (19.26 - 19.32) ms19.24 ± (19.20 - 19.28) ms-0.3%
process.time_to_main_ms71.77 ± (71.63 - 71.92) ms71.28 ± (71.14 - 71.43) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.67) MB7.68 ± (7.67 - 7.69) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.21 ± (19.17 - 19.25) ms19.41 ± (19.37 - 19.45) ms+1.1%✅⬆️
process.time_to_main_ms72.45 ± (72.33 - 72.58) ms73.14 ± (72.99 - 73.29) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.71) MB7.72 ± (7.71 - 7.73) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms297.60 ± (295.48 - 299.71) ms299.60 ± (297.26 - 301.93) ms+0.7%✅⬆️
process.time_to_main_ms495.08 ± (494.13 - 496.02) ms497.96 ± (496.88 - 499.03) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.90 ± (36.87 - 36.92) MB36.86 ± (36.83 - 36.89) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.5%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration199.34 ± (199.22 - 200.22) ms195.80 ± (195.86 - 196.91) ms-1.8%
.NET Framework 4.8 - Bailout
duration202.45 ± (202.48 - 203.42) ms199.52 ± (199.07 - 200.12) ms-1.5%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1193.87 ± (1195.59 - 1201.34) ms1184.32 ± (1185.57 - 1190.95) ms-0.8%
.NET Core 3.1 - Baseline
process.internal_duration_ms192.18 ± (191.74 - 192.62) ms190.75 ± (190.30 - 191.19) ms-0.7%
process.time_to_main_ms83.17 ± (82.90 - 83.43) ms81.86 ± (81.60 - 82.12) ms-1.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.12 - 16.17) MB16.10 ± (16.07 - 16.12) MB-0.3%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms192.65 ± (192.21 - 193.09) ms189.76 ± (189.26 - 190.26) ms-1.5%
process.time_to_main_ms84.74 ± (84.53 - 84.95) ms83.39 ± (83.12 - 83.65) ms-1.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.07 - 16.14) MB16.21 ± (16.19 - 16.24) MB+0.7%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.4%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms384.61 ± (383.35 - 385.88) ms385.77 ± (384.43 - 387.12) ms+0.3%✅⬆️
process.time_to_main_ms535.07 ± (533.97 - 536.17) ms533.64 ± (532.29 - 534.99) ms-0.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.36 ± (57.18 - 57.53) MB57.51 ± (57.35 - 57.67) MB+0.3%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms198.43 ± (198.09 - 198.76) ms196.16 ± (195.72 - 196.59) ms-1.1%
process.time_to_main_ms72.29 ± (72.05 - 72.54) ms71.80 ± (71.55 - 72.04) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.36 ± (16.34 - 16.38) MB16.42 ± (16.40 - 16.44) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms196.72 ± (196.31 - 197.12) ms197.91 ± (197.42 - 198.40) ms+0.6%✅⬆️
process.time_to_main_ms73.35 ± (73.10 - 73.59) ms73.82 ± (73.59 - 74.05) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.41 ± (16.38 - 16.43) MB16.46 ± (16.43 - 16.48) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.3%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms586.98 ± (584.43 - 589.52) ms588.54 ± (585.89 - 591.18) ms+0.3%✅⬆️
process.time_to_main_ms544.90 ± (543.76 - 546.05) ms545.65 ± (544.58 - 546.72) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.06 ± (60.98 - 61.15) MB61.29 ± (61.18 - 61.40) MB+0.4%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.4%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms194.34 ± (193.93 - 194.74) ms194.14 ± (193.64 - 194.64) ms-0.1%
process.time_to_main_ms71.05 ± (70.77 - 71.34) ms71.45 ± (71.21 - 71.68) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.73 - 11.78) MB11.78 ± (11.76 - 11.80) MB+0.3%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms194.37 ± (194.07 - 194.67) ms192.92 ± (192.58 - 193.27) ms-0.7%
process.time_to_main_ms72.45 ± (72.22 - 72.69) ms72.22 ± (72.03 - 72.41) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.82 ± (11.80 - 11.84) MB11.81 ± (11.79 - 11.83) MB-0.1%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.5%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms517.23 ± (514.71 - 519.74) ms516.30 ± (513.78 - 518.83) ms-0.2%
process.time_to_main_ms493.35 ± (492.56 - 494.14) ms492.63 ± (491.87 - 493.40) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.65 ± (50.62 - 50.69) MB50.65 ± (50.62 - 50.69) MB-0.0%
runtime.dotnet.threads.count30 ± (29 - 30)29 ± (29 - 30)-0.2%
Comparison explanation

Execution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (73ms)  : 70, 75
    master - mean (73ms)  : 70, 77

    section Bailout
    This PR (8777) - mean (78ms)  : 74, 81
    master - mean (76ms)  : 74, 78

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (1,096ms)  : 1046, 1146
    master - mean (1,095ms)  : 1041, 1150

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (113ms)  : 108, 118
    master - mean (114ms)  : 108, 120

    section Bailout
    This PR (8777) - mean (117ms)  : 112, 123
    master - mean (113ms)  : 111, 116

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (789ms)  : 764, 815
    master - mean (793ms)  : 767, 818

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (101ms)  : 97, 106
    master - mean (100ms)  : 96, 104

    section Bailout
    This PR (8777) - mean (104ms)  : 98, 109
    master - mean (103ms)  : 99, 108

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (951ms)  : 910, 992
    master - mean (944ms)  : 902, 986

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (98ms)  : 96, 101
    master - mean (99ms)  : 95, 102

    section Bailout
    This PR (8777) - mean (100ms)  : 98, 103
    master - mean (99ms)  : 97, 101

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (828ms)  : 785, 871
    master - mean (821ms)  : 782, 860

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (196ms)  : 188, 204
    master - mean (200ms)  : 192, 207

    section Bailout
    This PR (8777) - mean (200ms)  : 193, 206
    master - mean (203ms)  : 198, 208

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (1,188ms)  : 1151, 1225
    master - mean (1,198ms)  : 1157, 1240

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (282ms)  : 275, 289
    master - mean (284ms)  : 277, 292

    section Bailout
    This PR (8777) - mean (282ms)  : 276, 288
    master - mean (286ms)  : 281, 291

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (960ms)  : 929, 991
    master - mean (959ms)  : 940, 978

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (276ms)  : 268, 284
    master - mean (279ms)  : 274, 284

    section Bailout
    This PR (8777) - mean (280ms)  : 273, 288
    master - mean (278ms)  : 274, 283

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (1,160ms)  : 1126, 1195
    master - mean (1,160ms)  : 1125, 1196

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8777) - mean (275ms)  : 268, 283
    master - mean (276ms)  : 270, 281

    section Bailout
    This PR (8777) - mean (275ms)  : 270, 281
    master - mean (277ms)  : 273, 280

    section CallTarget+Inlining+NGEN
    This PR (8777) - mean (1,040ms)  : 1004, 1075
    master - mean (1,040ms)  : 1003, 1078

Loading

@pr-commenter

pr-commenter Bot commented Jun 11, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-12 10:36:01

Comparing candidate commit 49a2f28 in PR branch gleocadie/improve-memory-consumption-librariesinfocache with baseline commit c6f007b in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 59 known flaky benchmarks, 67 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0

  • 🟩 throughput [+18625.319op/s; +24334.032op/s] or [+6.813%; +8.901%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0

  • 🟩 throughput [+13844.840op/s; +19436.761op/s] or [+6.683%; +9.382%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-7340.879op/s; -6902.319op/s] or [-8.704%; -8.184%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟥 throughput [-7545.338op/s; -6259.171op/s] or [-7.672%; -6.364%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+300.426ms; +306.932ms] or [+149.082%; +152.310%]
  • 🟥 throughput [-44.561op/s; -40.954op/s] or [-8.017%; -7.368%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 execution_time [+380.154ms; +381.782ms] or [+300.345%; +301.631%]
  • 🟩 throughput [+91.338op/s; +94.127op/s] or [+12.043%; +12.410%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+392.814ms; +396.610ms] or [+347.626%; +350.985%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-16.119ms; -11.917ms] or [-7.528%; -5.566%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.500%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-272297.442op/s; -268075.677op/s] or [-27.803%; -27.372%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.381ms; -21.524ms] or [-11.765%; -9.599%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-150252.617op/s; -134249.907op/s] or [-21.588%; -19.289%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟩 throughput [+9042.903op/s; +11949.203op/s] or [+5.754%; +7.603%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 throughput [+8206.813op/s; +10870.542op/s] or [+6.538%; +8.660%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+443135.014op/s; +468477.708op/s] or [+14.776%; +15.621%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-19.051ms; -14.723ms] or [-8.782%; -6.787%]
  • 🟩 throughput [+138372.418op/s; +193992.094op/s] or [+5.492%; +7.700%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+300.526ms; +301.246ms] or [+150.163%; +150.522%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+296.770ms; +311.999ms] or [+149.662%; +157.342%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟥 execution_time [+299.592ms; +301.999ms] or [+150.911%; +152.124%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+296.889ms; +298.281ms] or [+145.820%; +146.504%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+296.682ms; +298.013ms] or [+145.037%; +145.687%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+297.966ms; +301.114ms] or [+148.923%; +150.496%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+20.752µs; +44.473µs] or [+6.625%; +14.198%]
  • 🟥 throughput [-415.521op/s; -215.912op/s] or [-12.953%; -6.731%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.490ms; +300.279ms] or [+149.476%; +149.870%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • unstable execution_time [+328.319ms; +388.585ms] or [+356.732%; +422.213%]
  • 🟩 throughput [+640.599op/s; +842.925op/s] or [+5.264%; +6.926%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • 🟥 execution_time [+362.640ms; +370.478ms] or [+275.349%; +281.301%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+260.998ms; +324.295ms] or [+120.004%; +149.107%]
  • 🟥 throughput [-561.594op/s; -505.398op/s] or [-50.886%; -45.794%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+199.857ms; +333.142ms] or [+85.171%; +141.971%]
  • 🟥 throughput [-672.529op/s; -589.015op/s] or [-44.858%; -39.287%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+328.867ms; +343.074ms] or [+196.700%; +205.198%]
  • 🟥 throughput [-403.938op/s; -367.244op/s] or [-28.126%; -25.571%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 throughput [+27.056op/s; +41.827op/s] or [+5.341%; +8.257%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.538ms; +305.530ms] or [+152.856%; +153.859%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+302.255ms; +303.910ms] or [+151.461%; +152.290%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+301.912ms; +305.324ms] or [+151.668%; +153.382%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.470ms; +304.966ms] or [+151.890%; +153.144%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+296.611ms; +298.676ms] or [+146.661%; +147.682%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+302.046ms; +306.043ms] or [+153.090%; +155.116%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+306.083ms; +308.494ms] or [+153.626%; +154.836%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+302.384ms; +319.633ms] or [+150.711%; +159.308%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+299.122ms; +307.567ms] or [+148.811%; +153.012%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-16.472ms; -12.775ms] or [-7.660%; -5.941%]
  • 🟩 throughput [+19346.285op/s; +25790.232op/s] or [+5.307%; +7.075%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+12.362µs; +59.480µs] or [+3.054%; +14.692%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-20.116KB; -20.092KB] or [-7.338%; -7.329%]
  • unstable execution_time [-38.094µs; +16.868µs] or [-7.529%; +3.334%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • unstable execution_time [-43.120µs; +19.659µs] or [-7.472%; +3.407%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • unstable execution_time [+7.687µs; +12.004µs] or [+18.170%; +28.373%]
  • 🟥 throughput [-5362.120op/s; -3510.264op/s] or [-22.573%; -14.777%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-14.192µs; -6.466µs] or [-22.018%; -10.032%]
  • unstable throughput [+1608.592op/s; +3272.889op/s] or [+9.869%; +20.080%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.323ms; +302.823ms] or [+152.305%; +153.064%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+303.191ms; +305.535ms] or [+154.323%; +155.516%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+298.106ms; +300.670ms] or [+149.239%; +150.522%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+28147.477op/s; +33006.509op/s] or [+5.328%; +6.247%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.754ms; +302.181ms] or [+149.401%; +150.610%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+302.239ms; +304.157ms] or [+151.770%; +152.733%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+304.813ms; +307.110ms] or [+154.581%; +155.746%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.992ms; +301.065ms] or [+149.638%; +150.173%]
  • 🟩 throughput [+60326938.390op/s; +60985686.060op/s] or [+43.934%; +44.414%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟥 execution_time [+421.478ms; +427.007ms] or [+524.182%; +531.059%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.961ms; +301.022ms] or [+149.614%; +150.143%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+72899.772op/s; +82407.442op/s] or [+6.806%; +7.694%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+79832.790op/s; +90925.975op/s] or [+7.929%; +9.030%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+49919.007op/s; +55910.807op/s] or [+9.064%; +10.152%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@gleocadie
gleocadie marked this pull request as ready for review June 12, 2026 06:57
@gleocadie
gleocadie requested a review from a team as a code owner June 12, 2026 06:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce3a40484a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LibrariesInfoCache.cpp Outdated
@gleocadie
gleocadie force-pushed the gleocadie/improve-memory-consumption-librariesinfocache branch from ce3a404 to 4da569c Compare June 12, 2026 07:18
@gleocadie
gleocadie force-pushed the gleocadie/improve-memory-consumption-librariesinfocache branch from 4da569c to 396789d Compare June 12, 2026 07:29

@chrisnas chrisnas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
maybe log per module when IsFileRangeValid() fails

@andrewlock
andrewlock merged commit f308e58 into master Jun 15, 2026
79 of 83 checks passed
@andrewlock
andrewlock deleted the gleocadie/improve-memory-consumption-librariesinfocache branch June 15, 2026 13:28
@github-actions github-actions Bot added this to the vNext-v3 milestone Jun 15, 2026
zacharycmontoya pushed a commit that referenced this pull request Jun 16, 2026
## Summary of changes

Improve memory overhead of the `LibrariesCacheInfo`.

## Reason for change

`LibrariesCacheInfo` component caches ELF symbols to improve stack
walking. But this comes at a cost CPU + Memory.

Today (master)
```
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997] LibrariesInfoCache stats:
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Cache reloads: 10
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Total CPU (worker): 42 ms
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Libraries in cache: 21
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Module regions: 18
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Symbol entries: 27179
[2026-06-11 10:58:49.687 | info | PId: 140997 | TId: 140997]   Memory current: 1410520 bytes
```

We can see a 42ms CPU usage and 1.4MB memory usage for 27179 symbols.
42ms of CPU over the lifetime of the application is totally negligible,
but 1.4MB leaves a mark.

This PR does 2 improvements:
- Replace std::function Deleters
- Compact FuncEntry for ARM64

With this PR
```
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347] LibrariesInfoCache stats:
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Cache reloads: 13
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Total CPU (worker): 57 ms
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Libraries in cache: 21
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Module regions: 18
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Symbol entries: 27179
[2026-06-11 07:53:01.910 | info | PId: 20347 | TId: 20347]   Memory current: 565528 bytes
```

## Implementation details
- Replace std::unique_ptr<T, std::function<void(void*)>> with a trivial
deleter struct `PmrDeleter`
- Store function entries relative to their module base:
Works because: modules are always < 4GB (shared libraries mapped within
32-bit offset range from their base)


## Test coverage

## Other details
<!-- Fixes #{issue} -->


<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:profiler Issues related to the continous-profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants