Skip to content

Conversation

@chrisnas
Copy link
Contributor

Summary of changes

Allow the generation of heap snapshots that are sent to the backend

Reason for change

For memory leak workflow, we would like to compare the surviving objects count to identify the leaky ones. These heap snapshots will be transformed into class histograms to look like what is generated by Java.

Implementation details

The .NET runtime allows the creation of "gcdump" thanks to dotnet-gcdump tool. Behind the scene, an induced GC is triggered when an event pipe session is created with the right keyword/verbosity. Undocumented events are then emitted by the runtime at the end of the GC - read https://chnasarre.medium.com/net-gcdump-internals-fcce5d327be7?source=friends_link&sk=3225ff119458adafc0e6935951fcc323 for more details.

Test coverage

Test added as needed

Other details

@chrisnas chrisnas requested a review from a team as a code owner October 21, 2025 08:22
@github-actions github-actions bot added the area:profiler Issues related to the continous-profiler label Oct 21, 2025
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

This is just configuration, right? There's no implementation of taking the snapshot here?

@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

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 shown 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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (71ms)  : 70, 73
     .   : milestone, 71,
    master - mean (71ms)  : 70, 73
     .   : milestone, 71,

    section Baseline
    This PR (7681) - mean (68ms)  : 66, 70
     .   : milestone, 68,
    master - mean (68ms)  : 66, 69
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (1,040ms)  : 999, 1081
     .   : milestone, 1040,
    master - mean (1,039ms)  : 1002, 1077
     .   : milestone, 1039,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (106ms)  : 104, 107
     .   : milestone, 106,
    master - mean (106ms)  : 104, 107
     .   : milestone, 106,

    section Baseline
    This PR (7681) - mean (105ms)  : 103, 107
     .   : milestone, 105,
    master - mean (105ms)  : 102, 107
     .   : milestone, 105,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (743ms)  : 720, 767
     .   : milestone, 743,
    master - mean (742ms)  : 724, 760
     .   : milestone, 742,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (94ms)  : 92, 95
     .   : milestone, 94,
    master - mean (93ms)  : 93, 94
     .   : milestone, 93,

    section Baseline
    This PR (7681) - mean (93ms)  : 91, 95
     .   : milestone, 93,
    master - mean (93ms)  : 91, 95
     .   : milestone, 93,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (704ms)  : 679, 729
     .   : milestone, 704,
    master - mean (704ms)  : 670, 738
     .   : milestone, 704,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (92ms)  : 91, 93
     .   : milestone, 92,
    master - mean (92ms)  : 91, 93
     .   : milestone, 92,

    section Baseline
    This PR (7681) - mean (92ms)  : 89, 94
     .   : milestone, 92,
    master - mean (91ms)  : 89, 94
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (656ms)  : 642, 671
     .   : milestone, 656,
    master - mean (659ms)  : 646, 673
     .   : milestone, 659,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (197ms)  : 192, 201
     .   : milestone, 197,
    master - mean (195ms)  : 193, 198
     .   : milestone, 195,

    section Baseline
    This PR (7681) - mean (192ms)  : 189, 196
     .   : milestone, 192,
    master - mean (193ms)  : 188, 198
     .   : milestone, 193,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (1,168ms)  : 1104, 1233
     .   : milestone, 1168,
    master - mean (1,171ms)  : 1105, 1237
     .   : milestone, 1171,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (276ms)  : 271, 282
     .   : milestone, 276,
    master - mean (276ms)  : 272, 281
     .   : milestone, 276,

    section Baseline
    This PR (7681) - mean (276ms)  : 272, 280
     .   : milestone, 276,
    master - mean (276ms)  : 271, 280
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (948ms)  : 908, 989
     .   : milestone, 948,
    master - mean (942ms)  : 906, 978
     .   : milestone, 942,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (269ms)  : 266, 272
     .   : milestone, 269,
    master - mean (269ms)  : 266, 272
     .   : milestone, 269,

    section Baseline
    This PR (7681) - mean (270ms)  : 265, 275
     .   : milestone, 270,
    master - mean (268ms)  : 264, 273
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (923ms)  : 881, 966
     .   : milestone, 923,
    master - mean (924ms)  : 874, 974
     .   : milestone, 924,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7681) - mean (269ms)  : 264, 275
     .   : milestone, 269,
    master - mean (268ms)  : 266, 271
     .   : milestone, 268,

    section Baseline
    This PR (7681) - mean (268ms)  : 264, 271
     .   : milestone, 268,
    master - mean (268ms)  : 264, 273
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (7681) - mean (853ms)  : 831, 874
     .   : milestone, 853,
    master - mean (853ms)  : 836, 870
     .   : milestone, 853,

Loading

@pr-commenter
Copy link

pr-commenter bot commented Oct 24, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7681 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.140
  • 2 benchmarks are slower, with geometric mean 1.204
  • 6 benchmarks have fewer allocations
  • 6 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.7μs 58.8ns 338ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14.3μs 71.8ns 337ns 0 0 0 5.68 KB
master StartStopWithChild net472 22μs 124ns 792ns 1 0.334 0.111 6.06 KB
#7681 StartStopWithChild net6.0 10.7μs 56ns 291ns 0 0 0 5.52 KB
#7681 StartStopWithChild netcoreapp3.1 14.1μs 70.5ns 307ns 0 0 0 5.71 KB
#7681 StartStopWithChild net472 22.4μs 120ns 656ns 0.894 0.224 0 6.07 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7681

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 2.72 KB 2.7 KB -15 B -0.55%
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.35 KB 3.31 KB -46 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 952μs 280ns 1.08μs 0 0 0 2.72 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 170ns 660ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.2ms 77ns 278ns 0 0 0 3.35 KB
#7681 WriteAndFlushEnrichedTraces net6.0 929μs 254ns 985ns 0 0 0 2.7 KB
#7681 WriteAndFlushEnrichedTraces netcoreapp3.1 1.06ms 207ns 801ns 0 0 0 2.7 KB
#7681 WriteAndFlushEnrichedTraces net472 1.21ms 548ns 2.05μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.09μs 6.29ns 50.3ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.45μs 8.23ns 57ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.05μs 0.276ns 1.03ns 0.191 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 6.99μs 38.6ns 222ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 8.98μs 22.8ns 88.3ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.64μs 6.04ns 23.4ns 0.729 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 334ns 0.361ns 1.4ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 400ns 1.93ns 8.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 296ns 0.0186ns 0.0644ns 0.0434 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.33μs 4.04ns 15.6ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.72μs 36.4ns 150ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.71μs 2.01ns 7.52ns 0.574 0 0 3.8 KB
#7681 AllCycleSimpleBody net6.0 1.1μs 6.1ns 28.6ns 0 0 0 1.22 KB
#7681 AllCycleSimpleBody netcoreapp3.1 1.4μs 7.49ns 38.2ns 0 0 0 1.2 KB
#7681 AllCycleSimpleBody net472 1.02μs 0.702ns 2.72ns 0.195 0 0 1.23 KB
#7681 AllCycleMoreComplexBody net6.0 7.02μs 38.3ns 213ns 0 0 0 4.72 KB
#7681 AllCycleMoreComplexBody netcoreapp3.1 9μs 45ns 191ns 0 0 0 4.62 KB
#7681 AllCycleMoreComplexBody net472 7.56μs 3.88ns 15ns 0.717 0 0 4.74 KB
#7681 ObjectExtractorSimpleBody net6.0 317ns 1.78ns 11.9ns 0 0 0 280 B
#7681 ObjectExtractorSimpleBody netcoreapp3.1 399ns 2.27ns 15.2ns 0 0 0 272 B
#7681 ObjectExtractorSimpleBody net472 301ns 0.045ns 0.169ns 0.0439 0 0 281 B
#7681 ObjectExtractorMoreComplexBody net6.0 6.33μs 4.45ns 15.4ns 0 0 0 3.78 KB
#7681 ObjectExtractorMoreComplexBody netcoreapp3.1 7.77μs 38.9ns 165ns 0 0 0 3.69 KB
#7681 ObjectExtractorMoreComplexBody net472 6.7μs 5.25ns 20.3ns 0.602 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 77.4μs 32.7ns 118ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97.8μs 36.1ns 140ns 0 0 0 32.4 KB
master EncodeArgs net472 110μs 12.1ns 46.8ns 4.96 0 0 32.51 KB
master EncodeLegacyArgs net6.0 146μs 194ns 752ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 168ns 650ns 0 0 0 2.15 KB
master EncodeLegacyArgs net472 263μs 212ns 735ns 0 0 0 2.16 KB
#7681 EncodeArgs net6.0 78.1μs 169ns 654ns 0 0 0 32.4 KB
#7681 EncodeArgs netcoreapp3.1 98.3μs 196ns 759ns 0 0 0 32.4 KB
#7681 EncodeArgs net472 109μs 7.7ns 27.7ns 4.93 0 0 32.5 KB
#7681 EncodeLegacyArgs net6.0 144μs 37.5ns 145ns 0 0 0 2.14 KB
#7681 EncodeLegacyArgs netcoreapp3.1 198μs 151ns 586ns 0 0 0 2.14 KB
#7681 EncodeLegacyArgs net472 265μs 121ns 470ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 406μs 111ns 400ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 413μs 229ns 885ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 447μs 101ns 391ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 294μs 118ns 457ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 299μs 161ns 556ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 319μs 49.9ns 180ns 0 0 0 2.28 KB
#7681 RunWafRealisticBenchmark net6.0 418μs 79.5ns 308ns 0 0 0 4.55 KB
#7681 RunWafRealisticBenchmark netcoreapp3.1 418μs 320ns 1.15μs 0 0 0 4.48 KB
#7681 RunWafRealisticBenchmark net472 432μs 48.6ns 168ns 0 0 0 4.66 KB
#7681 RunWafRealisticBenchmarkWithAttack net6.0 285μs 63.9ns 221ns 0 0 0 2.24 KB
#7681 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 300μs 39.8ns 149ns 0 0 0 2.22 KB
#7681 RunWafRealisticBenchmarkWithAttack net472 311μs 29.7ns 115ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 62.2μs 87.6ns 303ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.8μs 76.2ns 285ns 0 0 0 17.42 KB
master SendRequest net472 0.0175ns 0.00341ns 0.0132ns 0 0 0 0 b
#7681 SendRequest net6.0 62.4μs 45.2ns 163ns 0 0 0 14.52 KB
#7681 SendRequest netcoreapp3.1 72.5μs 98.9ns 383ns 0 0 0 17.42 KB
#7681 SendRequest net472 0.0057ns 0.00251ns 0.0097ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7681

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1.128 819,663.28 924,211.25

More allocations ⚠️ in #7681

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 2 B 4 B 2 B 100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 2 B 3 B 1 B 50.00%

Fewer allocations 🎉 in #7681

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 73 B 0 b -73 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 47 B 0 b -47 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.86ms 3.83μs 14.9μs 0 0 0 640 KB
master OriginalCharSlice netcoreapp3.1 2.05ms 4.47μs 16.1μs 0 0 0 640 KB
master OriginalCharSlice net472 2.69ms 2.18μs 8.46μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.44ms 1.36μs 5.28μs 0 0 0 2 B
master OptimizedCharSlice netcoreapp3.1 1.65ms 264ns 989ns 0 0 0 1 B
master OptimizedCharSlice net472 1.9ms 298ns 1.12μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 820μs 66.1ns 256ns 0 0 0 2 B
master OptimizedCharSliceWithPool netcoreapp3.1 811μs 61.5ns 238ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.19ms 98.4ns 381ns 0 0 0 47 B
#7681 OriginalCharSlice net6.0 1.92ms 3.45μs 12.9μs 0 0 0 640 KB
#7681 OriginalCharSlice netcoreapp3.1 2.13ms 10μs 41.3μs 0 0 0 640 KB
#7681 OriginalCharSlice net472 2.63ms 232ns 870ns 100 0 0 641.95 KB
#7681 OptimizedCharSlice net6.0 1.39ms 102ns 380ns 0 0 0 4 B
#7681 OptimizedCharSlice netcoreapp3.1 1.72ms 420ns 1.57μs 0 0 0 1 B
#7681 OptimizedCharSlice net472 1.97ms 920ns 3.44μs 0 0 0 0 b
#7681 OptimizedCharSliceWithPool net6.0 924μs 63ns 244ns 0 0 0 3 B
#7681 OptimizedCharSliceWithPool netcoreapp3.1 808μs 47.3ns 183ns 0 0 0 1 B
#7681 OptimizedCharSliceWithPool net472 1.17ms 87.7ns 340ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7681

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 1.140 932,078.33 817,893.33

More allocations ⚠️ in #7681

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.57 KB 42.56 KB 990 B 2.38%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.76 KB 42 KB 235 B 0.56%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 747μs 1.15μs 4.45μs 0 0 0 41.57 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 772μs 5.49μs 54.9μs 0 0 0 41.76 KB
master WriteAndFlushEnrichedTraces net472 931μs 4.28μs 16.6μs 8.33 0 0 55.98 KB
#7681 WriteAndFlushEnrichedTraces net6.0 726μs 3.51μs 14.9μs 0 0 0 42.56 KB
#7681 WriteAndFlushEnrichedTraces netcoreapp3.1 698μs 3.75μs 20.2μs 0 0 0 42 KB
#7681 WriteAndFlushEnrichedTraces net472 818μs 2.74μs 10.2μs 8.33 0 0 56.22 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.9μs 9.66ns 44.3ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.62μs 12.6ns 53.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.87μs 3.83ns 14.3ns 0.156 0.0142 0 987 B
#7681 ExecuteNonQuery net6.0 1.9μs 9.67ns 41ns 0 0 0 1.02 KB
#7681 ExecuteNonQuery netcoreapp3.1 2.61μs 2.98ns 11.1ns 0 0 0 1.02 KB
#7681 ExecuteNonQuery net472 2.94μs 3.79ns 14.7ns 0.147 0.0147 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.73μs 1.46ns 5.65ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.18μs 11.1ns 49.8ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.53μs 1.9ns 6.84ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.84μs 7.43ns 28.8ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.36μs 8.34ns 32.3ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.63μs 0.776ns 2.8ns 0.163 0 0 1.1 KB
#7681 CallElasticsearch net6.0 1.79μs 2.14ns 8.01ns 0 0 0 1.03 KB
#7681 CallElasticsearch netcoreapp3.1 2.19μs 10.6ns 42.2ns 0 0 0 1.03 KB
#7681 CallElasticsearch net472 3.61μs 3.76ns 14.6ns 0.161 0 0 1.04 KB
#7681 CallElasticsearchAsync net6.0 1.93μs 1.74ns 6.51ns 0 0 0 1.01 KB
#7681 CallElasticsearchAsync netcoreapp3.1 2.32μs 10ns 38.8ns 0 0 0 1.08 KB
#7681 CallElasticsearchAsync net472 3.66μs 4.22ns 15.8ns 0.162 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.87μs 4.01ns 15.5ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.51μs 8.35ns 32.3ns 0 0 0 952 B
master ExecuteAsync net472 2.58μs 1.31ns 4.89ns 0.141 0 0 915 B
#7681 ExecuteAsync net6.0 1.98μs 4.69ns 17.5ns 0 0 0 952 B
#7681 ExecuteAsync netcoreapp3.1 2.39μs 6.8ns 26.3ns 0 0 0 952 B
#7681 ExecuteAsync net472 2.6μs 8.27ns 32ns 0.142 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 7.19μs 3.43ns 12.4ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.67μs 19.4ns 75ns 0 0 0 2.9 KB
master SendAsync net472 12.5μs 8.63ns 33.4ns 0.497 0 0 3.18 KB
#7681 SendAsync net6.0 6.7μs 5.79ns 20.1ns 0 0 0 2.36 KB
#7681 SendAsync netcoreapp3.1 8.66μs 15.8ns 59.3ns 0 0 0 2.9 KB
#7681 SendAsync net472 12.3μs 7.29ns 26.3ns 0.493 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7681

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 1.285 453,550.00 582,750.00

More allocations ⚠️ in #7681

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 275.24 KB 352.3 KB 77.06 KB 28.00%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%

Fewer allocations 🎉 in #7681

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 45.32 KB 43.1 KB -2.22 KB -4.89%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 274.41 KB 258.35 KB -16.06 KB -5.85%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.9μs 314ns 2.93μs 0 0 0 45.32 KB
master StringConcatBenchmark netcoreapp3.1 51.9μs 506ns 4.83μs 0 0 0 42.9 KB
master StringConcatBenchmark net472 56.5μs 270ns 1.05μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 470μs 1.99μs 7.18μs 0 0 0 274.41 KB
master StringConcatAspectBenchmark netcoreapp3.1 468μs 5.37μs 52.3μs 0 0 0 275.95 KB
master StringConcatAspectBenchmark net472 417μs 2.31μs 14.4μs 0 0 0 275.24 KB
#7681 StringConcatBenchmark net6.0 52.3μs 771ns 7.67μs 0 0 0 43.1 KB
#7681 StringConcatBenchmark netcoreapp3.1 52.2μs 614ns 5.95μs 0 0 0 42.84 KB
#7681 StringConcatBenchmark net472 57.5μs 148ns 555ns 0 0 0 65.54 KB
#7681 StringConcatAspectBenchmark net6.0 463μs 1.31μs 4.71μs 0 0 0 258.35 KB
#7681 StringConcatAspectBenchmark netcoreapp3.1 583μs 2.9μs 12μs 0 0 0 276.83 KB
#7681 StringConcatAspectBenchmark net472 404μs 2.17μs 11.7μs 0 0 0 352.3 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.67μs 13.5ns 58.8ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.6μs 17.5ns 74.4ns 0 0 0 1.7 KB
master EnrichedLog net472 4.02μs 4.38ns 16.4ns 0.241 0 0 1.64 KB
#7681 EnrichedLog net6.0 2.65μs 12.4ns 46.5ns 0 0 0 1.7 KB
#7681 EnrichedLog netcoreapp3.1 3.56μs 18.9ns 92.6ns 0 0 0 1.7 KB
#7681 EnrichedLog net472 3.98μs 6.15ns 23ns 0.26 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 121μs 64.4ns 241ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 244ns 944ns 0 0 0 4.31 KB
master EnrichedLog net472 167μs 105ns 406ns 0 0 0 4.52 KB
#7681 EnrichedLog net6.0 123μs 48.7ns 189ns 0 0 0 4.31 KB
#7681 EnrichedLog netcoreapp3.1 128μs 196ns 734ns 0 0 0 4.31 KB
#7681 EnrichedLog net472 168μs 116ns 450ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 5.13μs 7.62ns 28.5ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.77μs 16.5ns 63.7ns 0 0 0 2.26 KB
master EnrichedLog net472 7.49μs 5.68ns 22ns 0.299 0 0 2.08 KB
#7681 EnrichedLog net6.0 4.85μs 23.2ns 89.9ns 0 0 0 2.26 KB
#7681 EnrichedLog netcoreapp3.1 7μs 19.8ns 76.6ns 0 0 0 2.26 KB
#7681 EnrichedLog net472 7.61μs 4.63ns 17.9ns 0.302 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.93μs 10ns 49.1ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.65μs 12.4ns 48.2ns 0 0 0 1.2 KB
master SendReceive net472 3.05μs 1.37ns 5.12ns 0.182 0 0 1.2 KB
#7681 SendReceive net6.0 2.03μs 10.2ns 44.7ns 0 0 0 1.2 KB
#7681 SendReceive netcoreapp3.1 2.65μs 8.89ns 34.4ns 0 0 0 1.2 KB
#7681 SendReceive net472 3.06μs 1.27ns 4.92ns 0.184 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.25μs 16.5ns 59.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.64μs 11.1ns 42.9ns 0 0 0 1.63 KB
master EnrichedLog net472 6.55μs 5.53ns 21.4ns 0.293 0 0 2.03 KB
#7681 EnrichedLog net6.0 4.19μs 9.48ns 36.7ns 0 0 0 1.58 KB
#7681 EnrichedLog netcoreapp3.1 5.57μs 7.21ns 27.9ns 0 0 0 1.63 KB
#7681 EnrichedLog net472 6.49μs 9.37ns 36.3ns 0.291 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 785ns 0.322ns 1.25ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 966ns 4.8ns 22.5ns 0 0 0 576 B
master StartFinishSpan net472 920ns 0.57ns 2.21ns 0.0878 0 0 578 B
master StartFinishScope net6.0 924ns 1.26ns 4.86ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.24μs 5.83ns 22.6ns 0 0 0 696 B
master StartFinishScope net472 1.11μs 1.01ns 3.63ns 0.101 0 0 658 B
#7681 StartFinishSpan net6.0 771ns 3.87ns 18.5ns 0 0 0 576 B
#7681 StartFinishSpan netcoreapp3.1 975ns 4.64ns 18ns 0 0 0 576 B
#7681 StartFinishSpan net472 941ns 1.89ns 7.33ns 0.0896 0 0 578 B
#7681 StartFinishScope net6.0 919ns 0.396ns 1.53ns 0 0 0 696 B
#7681 StartFinishScope netcoreapp3.1 1.2μs 0.633ns 2.45ns 0 0 0 696 B
#7681 StartFinishScope net472 1.11μs 0.529ns 2.05ns 0.101 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.07μs 5.35ns 22.7ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.42μs 4.5ns 17.4ns 0 0 0 696 B
master RunOnMethodBegin net472 1.51μs 1.53ns 5.71ns 0.0981 0 0 658 B
#7681 RunOnMethodBegin net6.0 1.03μs 5.44ns 27.2ns 0 0 0 696 B
#7681 RunOnMethodBegin netcoreapp3.1 1.43μs 6.28ns 24.3ns 0 0 0 696 B
#7681 RunOnMethodBegin net472 1.5μs 4.21ns 15.8ns 0.104 0 0 658 B

@chrisnas
Copy link
Contributor Author

chrisnas commented Nov 7, 2025

This is just configuration, right? There's no implementation of taking the snapshot here?

Work in progress yes :^)
My last commit seems to generate a "class histogram" as expected by our backend when conditions are fullfiled

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