Skip to content

Conversation

@gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Oct 22, 2025

Summary of changes

Address perf issues found while trying integrating the new profiling API. But also a bug in the indices computation for sample value types.

Reason for change

We want to remove bugs in the profiler and reduce the profiler overhead.

Implementation details

  • ffiLabels can be made static to avoid allocating/deallocating at each sample. Since there is only one thread responsible to add a sample (and labels) into the profile, we can make the variable static and clean it when finished.
  • Use an object pool for the WalltimeProvider to avoid calling new/delete when the queue is emptied.
  • Use std::once_flag to compute once the profiler thread name and thread id. We keep the synchronization but simplify the code.
  • Create the labels visitor outside of the loop: avoiding creating an instance each time. This may help the compiler to improve the performance.
  • Fix bug in the SampleValueTypeProvider: increments the next index only if we used it. The indices must be sequential. The bad behavior is seen when calling GetOrRegister on the same value type multiple times.

Test coverage

Add new tests.

Other details

@gleocadie gleocadie requested a review from a team as a code owner October 22, 2025 13:05
@github-actions github-actions bot added the area:profiler Issues related to the continous-profiler label Oct 22, 2025
@pr-commenter
Copy link

pr-commenter bot commented Oct 22, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7696 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.585
  • 1 benchmarks are slower, with geometric mean 1.128
  • 4 benchmarks have fewer allocations
  • 7 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 ✔️ More allocations ⚠️

More allocations ⚠️ in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.05 KB 6.11 KB 63 B 1.04%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.8μs 60.3ns 376ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14.4μs 74.8ns 359ns 0 0 0 5.69 KB
master StartStopWithChild net472 22μs 114ns 536ns 0.973 0.324 0.108 6.05 KB
#7696 StartStopWithChild net6.0 10.1μs 14.1ns 50.8ns 0 0 0 5.52 KB
#7696 StartStopWithChild netcoreapp3.1 13.3μs 68.7ns 337ns 0 0 0 5.71 KB
#7696 StartStopWithChild net472 22μs 110ns 551ns 0.887 0.332 0 6.11 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.31 KB 3.35 KB 46 B 1.39%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 952μs 391ns 1.41μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 142ns 550ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 413ns 1.6μs 0 0 0 3.31 KB
#7696 WriteAndFlushEnrichedTraces net6.0 941μs 204ns 792ns 0 0 0 2.71 KB
#7696 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 234ns 905ns 0 0 0 2.7 KB
#7696 WriteAndFlushEnrichedTraces net472 1.19ms 725ns 2.71μs 0 0 0 3.35 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
master ObjectExtractorSimpleBody net6.0 340ns 0.246ns 0.919ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 396ns 2.18ns 11.9ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 308ns 0.17ns 0.658ns 0.0434 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.23μs 33.3ns 173ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.86μs 38.1ns 157ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.69μs 3.18ns 12.3ns 0.57 0 0 3.8 KB
#7696 AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7696 AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7696 AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7696 AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7696 AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7696 AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7696 ObjectExtractorSimpleBody net6.0 321ns 1.72ns 8.42ns 0 0 0 280 B
#7696 ObjectExtractorSimpleBody netcoreapp3.1 401ns 2.06ns 10.1ns 0 0 0 272 B
#7696 ObjectExtractorSimpleBody net472 301ns 0.0175ns 0.063ns 0.0439 0 0 281 B
#7696 ObjectExtractorMoreComplexBody net6.0 6.2μs 32.5ns 159ns 0 0 0 3.78 KB
#7696 ObjectExtractorMoreComplexBody netcoreapp3.1 7.83μs 28.7ns 111ns 0 0 0 3.69 KB
#7696 ObjectExtractorMoreComplexBody net472 6.67μs 0.718ns 2.69ns 0.601 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 76.9μs 106ns 409ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.8μs 295ns 1.14μs 0 0 0 32.4 KB
master EncodeArgs net472 109μs 22.8ns 88.4ns 4.89 0 0 32.51 KB
master EncodeLegacyArgs net6.0 144μs 13.8ns 53.4ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 202μs 340ns 1.27μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 264μs 45.6ns 176ns 0 0 0 2.16 KB
#7696 EncodeArgs net6.0 77.6μs 206ns 797ns 0 0 0 32.4 KB
#7696 EncodeArgs netcoreapp3.1 97.6μs 306ns 1.19μs 0 0 0 32.4 KB
#7696 EncodeArgs net472 109μs 13.2ns 51.1ns 4.92 0 0 32.5 KB
#7696 EncodeLegacyArgs net6.0 141μs 18.6ns 72ns 0 0 0 2.15 KB
#7696 EncodeLegacyArgs netcoreapp3.1 200μs 61.2ns 221ns 0 0 0 2.15 KB
#7696 EncodeLegacyArgs net472 263μs 36ns 130ns 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 393μs 217ns 840ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 415μs 96.2ns 347ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 427μs 27.3ns 98.4ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 283μs 35.1ns 131ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 298μs 225ns 870ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 310μs 30ns 116ns 0 0 0 2.29 KB
#7696 RunWafRealisticBenchmark net6.0 396μs 59.1ns 221ns 0 0 0 4.56 KB
#7696 RunWafRealisticBenchmark netcoreapp3.1 412μs 75.1ns 271ns 0 0 0 4.48 KB
#7696 RunWafRealisticBenchmark net472 432μs 45.9ns 178ns 0 0 0 4.66 KB
#7696 RunWafRealisticBenchmarkWithAttack net6.0 285μs 18.1ns 67.6ns 0 0 0 2.24 KB
#7696 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 296μs 101ns 378ns 0 0 0 2.22 KB
#7696 RunWafRealisticBenchmarkWithAttack net472 312μs 28.8ns 112ns 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 60.5μs 55.6ns 215ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.7μs 150ns 563ns 0 0 0 17.42 KB
master SendRequest net472 0.00267ns 0.00131ns 0.00506ns 0 0 0 0 b
#7696 SendRequest net6.0 61.5μs 60.6ns 227ns 0 0 0 14.52 KB
#7696 SendRequest netcoreapp3.1 72.4μs 252ns 907ns 0 0 0 17.42 KB
#7696 SendRequest net472 0.00391ns 0.00164ns 0.00634ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7696

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1.121 898,105.36 801,062.89

More allocations ⚠️ in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 1 B 11 B 10 B 1,000.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1 B 2 B 1 B 100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 4 B 7 B 3 B 75.00%

Fewer allocations 🎉 in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 6 B 0 b -6 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.89ms 919ns 3.44μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.12ms 7.88μs 30.5μs 0 0 0 640 KB
master OriginalCharSlice net472 2.55ms 190ns 713ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.38ms 243ns 940ns 0 0 0 4 B
master OptimizedCharSlice netcoreapp3.1 1.66ms 343ns 1.28μs 0 0 0 1 B
master OptimizedCharSlice net472 1.93ms 157ns 607ns 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 898μs 98.8ns 383ns 0 0 0 1 B
master OptimizedCharSliceWithPool netcoreapp3.1 811μs 166ns 621ns 0 0 0 6 B
master OptimizedCharSliceWithPool net472 1.15ms 114ns 440ns 0 0 0 0 b
#7696 OriginalCharSlice net6.0 1.98ms 501ns 1.94μs 0 0 0 640 KB
#7696 OriginalCharSlice netcoreapp3.1 2.12ms 8.77μs 34μs 0 0 0 640 KB
#7696 OriginalCharSlice net472 2.65ms 240ns 899ns 100 0 0 641.95 KB
#7696 OptimizedCharSlice net6.0 1.46ms 73.6ns 275ns 0 0 0 7 B
#7696 OptimizedCharSlice netcoreapp3.1 1.77ms 392ns 1.52μs 0 0 0 11 B
#7696 OptimizedCharSlice net472 1.91ms 245ns 948ns 0 0 0 0 b
#7696 OptimizedCharSliceWithPool net6.0 801μs 61.7ns 239ns 0 0 0 2 B
#7696 OptimizedCharSliceWithPool netcoreapp3.1 815μs 224ns 838ns 0 0 0 0 b
#7696 OptimizedCharSliceWithPool net472 1.13ms 62.5ns 225ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 Fewer allocations 🎉

Faster 🎉 in #7696

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 1.147 740,896.88 646,099.70

Fewer allocations 🎉 in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.24 KB 41.93 KB -315 B -0.75%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 742μs 2.01μs 7.79μs 0 0 0 41.64 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 726μs 1.04μs 4.04μs 0 0 0 42.24 KB
master WriteAndFlushEnrichedTraces net472 904μs 4.57μs 21μs 4.46 0 0 55.96 KB
#7696 WriteAndFlushEnrichedTraces net6.0 647μs 1.09μs 4.24μs 0 0 0 41.75 KB
#7696 WriteAndFlushEnrichedTraces netcoreapp3.1 652μs 2.94μs 15μs 0 0 0 41.93 KB
#7696 WriteAndFlushEnrichedTraces net472 914μs 2.59μs 9.35μs 4.46 0 0 56.01 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.95μs 0.533ns 1.99ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.6μs 1.89ns 6.81ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.91μs 3.49ns 13.5ns 0.143 0.0143 0 987 B
#7696 ExecuteNonQuery net6.0 1.86μs 9.3ns 38.3ns 0 0 0 1.02 KB
#7696 ExecuteNonQuery netcoreapp3.1 2.85μs 13.1ns 50.9ns 0 0 0 1.02 KB
#7696 ExecuteNonQuery net472 2.82μs 1.52ns 5.27ns 0.154 0.014 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.68μs 8.33ns 36.3ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.2μs 5.6ns 21.7ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.5μs 4.22ns 16.3ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.83μs 5.3ns 19.1ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.36μs 10.9ns 42.2ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.6μs 2.09ns 8.08ns 0.163 0 0 1.1 KB
#7696 CallElasticsearch net6.0 1.8μs 0.808ns 3.13ns 0 0 0 1.03 KB
#7696 CallElasticsearch netcoreapp3.1 2.24μs 10.7ns 41.4ns 0 0 0 1.03 KB
#7696 CallElasticsearch net472 3.63μs 2.26ns 8.44ns 0.163 0 0 1.04 KB
#7696 CallElasticsearchAsync net6.0 1.8μs 6.11ns 23.7ns 0 0 0 1.01 KB
#7696 CallElasticsearchAsync netcoreapp3.1 2.5μs 11.9ns 47.7ns 0 0 0 1.08 KB
#7696 CallElasticsearchAsync net472 3.76μs 3.15ns 11.8ns 0.169 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.88μs 8.97ns 35.9ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.44μs 5.09ns 19.7ns 0 0 0 952 B
master ExecuteAsync net472 2.63μs 2.23ns 8.63ns 0.143 0 0 915 B
#7696 ExecuteAsync net6.0 1.84μs 4.05ns 15.7ns 0 0 0 952 B
#7696 ExecuteAsync netcoreapp3.1 2.34μs 7.84ns 28.3ns 0 0 0 952 B
#7696 ExecuteAsync net472 2.6μs 9.23ns 35.8ns 0.132 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 6.86μs 6.71ns 26ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.72μs 26.2ns 102ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 7.61ns 28.5ns 0.487 0 0 3.18 KB
#7696 SendAsync net6.0 6.91μs 5.94ns 23ns 0 0 0 2.36 KB
#7696 SendAsync netcoreapp3.1 8.51μs 23.9ns 92.5ns 0 0 0 2.9 KB
#7696 SendAsync net472 12.3μs 8.9ns 34.5ns 0.491 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7696

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 1.128 41,750.00 47,100.00

Faster 🎉 in #7696

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 3.099 1,546,250.00 498,900.00

More allocations ⚠️ in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 250.46 KB 258.36 KB 7.9 KB 3.16%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.78 KB 44.04 KB 264 B 0.60%

Fewer allocations 🎉 in #7696

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 286.02 KB 278.53 KB -7.49 KB -2.62%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 335.15 KB 258.02 KB -77.14 KB -23.02%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 41.7μs 209ns 886ns 0 0 0 43.78 KB
master StringConcatBenchmark netcoreapp3.1 47.8μs 164ns 658ns 0 0 0 42.92 KB
master StringConcatBenchmark net472 57μs 261ns 1.04μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 441μs 645ns 2.23μs 0 0 0 250.46 KB
master StringConcatAspectBenchmark netcoreapp3.1 1.55ms 2.22μs 8.32μs 0 0 0 335.15 KB
master StringConcatAspectBenchmark net472 411μs 2.06μs 8.72μs 0 0 0 286.02 KB
#7696 StringConcatBenchmark net6.0 47μs 204ns 788ns 0 0 0 44.04 KB
#7696 StringConcatBenchmark netcoreapp3.1 50.4μs 290ns 2.03μs 0 0 0 42.8 KB
#7696 StringConcatBenchmark net472 56.6μs 258ns 998ns 0 0 0 57.34 KB
#7696 StringConcatAspectBenchmark net6.0 474μs 2.18μs 8.14μs 0 0 0 258.36 KB
#7696 StringConcatAspectBenchmark netcoreapp3.1 501μs 2.28μs 8.84μs 0 0 0 258.02 KB
#7696 StringConcatAspectBenchmark net472 402μs 1.81μs 12.6μs 0 0 0 278.53 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.63μs 4.76ns 17.8ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.54μs 18.5ns 90.6ns 0 0 0 1.71 KB
master EnrichedLog net472 3.84μs 1.57ns 5.87ns 0.25 0 0 1.64 KB
#7696 EnrichedLog net6.0 2.67μs 12.9ns 50ns 0 0 0 1.7 KB
#7696 EnrichedLog netcoreapp3.1 3.65μs 14.4ns 54.1ns 0 0 0 1.7 KB
#7696 EnrichedLog net472 3.84μs 3.43ns 13.3ns 0.25 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 124μs 89.6ns 323ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 25.6ns 92.4ns 0 0 0 4.31 KB
master EnrichedLog net472 168μs 42.9ns 166ns 0 0 0 4.52 KB
#7696 EnrichedLog net6.0 124μs 255ns 921ns 0 0 0 4.31 KB
#7696 EnrichedLog netcoreapp3.1 128μs 124ns 479ns 0 0 0 4.31 KB
#7696 EnrichedLog net472 167μs 45.3ns 175ns 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 4.97μs 13.2ns 51ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.8μs 12.1ns 46.8ns 0 0 0 2.26 KB
master EnrichedLog net472 7.7μs 8.85ns 34.3ns 0.307 0 0 2.08 KB
#7696 EnrichedLog net6.0 5.07μs 4.1ns 15.3ns 0 0 0 2.26 KB
#7696 EnrichedLog netcoreapp3.1 6.82μs 8.3ns 32.2ns 0 0 0 2.26 KB
#7696 EnrichedLog net472 7.65μs 7.83ns 29.3ns 0.306 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 2μs 0.971ns 3.5ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.69μs 1.35ns 5.25ns 0 0 0 1.2 KB
master SendReceive net472 3.18μs 2.59ns 10ns 0.19 0 0 1.2 KB
#7696 SendReceive net6.0 2.08μs 9.64ns 37.3ns 0 0 0 1.2 KB
#7696 SendReceive netcoreapp3.1 2.65μs 9.95ns 38.5ns 0 0 0 1.2 KB
#7696 SendReceive net472 3.18μs 7.72ns 29.9ns 0.19 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.4μs 14.9ns 57.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.73μs 19.8ns 76.5ns 0 0 0 1.63 KB
master EnrichedLog net472 6.71μs 5.97ns 22.3ns 0.299 0 0 2.03 KB
#7696 EnrichedLog net6.0 4.26μs 8.92ns 34.5ns 0 0 0 1.58 KB
#7696 EnrichedLog netcoreapp3.1 5.61μs 11.2ns 43.4ns 0 0 0 1.63 KB
#7696 EnrichedLog net472 6.67μs 6.87ns 26.6ns 0.298 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 790ns 0.365ns 1.41ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 981ns 5.14ns 26.2ns 0 0 0 576 B
master StartFinishSpan net472 920ns 0.55ns 2.06ns 0.0882 0 0 578 B
master StartFinishScope net6.0 912ns 3.36ns 12.6ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.17μs 6.25ns 31.3ns 0 0 0 696 B
master StartFinishScope net472 1.16μs 1.07ns 4.14ns 0.105 0 0 658 B
#7696 StartFinishSpan net6.0 783ns 3.9ns 16.1ns 0 0 0 576 B
#7696 StartFinishSpan netcoreapp3.1 980ns 0.513ns 1.99ns 0 0 0 576 B
#7696 StartFinishSpan net472 955ns 0.0987ns 0.356ns 0.0911 0 0 578 B
#7696 StartFinishScope net6.0 920ns 4.81ns 23.1ns 0 0 0 696 B
#7696 StartFinishScope netcoreapp3.1 1.19μs 5.25ns 20.3ns 0 0 0 696 B
#7696 StartFinishScope net472 1.21μs 2.67ns 10.3ns 0.104 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.06μs 5.42ns 26.5ns 0 0 0 697 B
master RunOnMethodBegin netcoreapp3.1 1.41μs 7.25ns 34.8ns 0 0 0 696 B
master RunOnMethodBegin net472 1.43μs 0.56ns 2.1ns 0.1 0 0 658 B
#7696 RunOnMethodBegin net6.0 1.1μs 1.98ns 7.67ns 0 0 0 696 B
#7696 RunOnMethodBegin netcoreapp3.1 1.4μs 6.79ns 28.8ns 0 0 0 696 B
#7696 RunOnMethodBegin net472 1.46μs 5.54ns 21.5ns 0.1 0 0 658 B

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

dd-trace-dotnet-ci-bot bot commented Oct 22, 2025

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 (7696) - mean (74ms)  : 73, 76
     .   : milestone, 74,
    master - mean (75ms)  : 74, 77
     .   : milestone, 75,

    section Baseline
    This PR (7696) - mean (70ms)  : 68, 73
     .   : milestone, 70,
    master - mean (71ms)  : 68, 75
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (1,069ms)  : 994, 1144
     .   : milestone, 1069,
    master - mean (1,072ms)  : 992, 1152
     .   : milestone, 1072,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (110ms)  : 108, 112
     .   : milestone, 110,
    master - mean (110ms)  : 108, 112
     .   : milestone, 110,

    section Baseline
    This PR (7696) - mean (110ms)  : 107, 113
     .   : milestone, 110,
    master - mean (110ms)  : 107, 112
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (757ms)  : 726, 789
     .   : milestone, 757,
    master - mean (761ms)  : 733, 788
     .   : milestone, 761,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (98ms)  : 95, 100
     .   : milestone, 98,
    master - mean (98ms)  : 96, 100
     .   : milestone, 98,

    section Baseline
    This PR (7696) - mean (98ms)  : 95, 101
     .   : milestone, 98,
    master - mean (97ms)  : 94, 101
     .   : milestone, 97,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (711ms)  : 674, 749
     .   : milestone, 711,
    master - mean (729ms)  : 671, 788
     .   : milestone, 729,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (98ms)  : 96, 100
     .   : milestone, 98,
    master - mean (98ms)  : 95, 100
     .   : milestone, 98,

    section Baseline
    This PR (7696) - mean (98ms)  : 93, 102
     .   : milestone, 98,
    master - mean (97ms)  : 94, 99
     .   : milestone, 97,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (675ms)  : 659, 691
     .   : milestone, 675,
    master - mean (679ms)  : 661, 698
     .   : milestone, 679,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (196ms)  : 194, 199
     .   : milestone, 196,
    master - mean (196ms)  : 193, 199
     .   : milestone, 196,

    section Baseline
    This PR (7696) - mean (193ms)  : 190, 196
     .   : milestone, 193,
    master - mean (193ms)  : 189, 197
     .   : milestone, 193,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (1,161ms)  : 1100, 1222
     .   : milestone, 1161,
    master - mean (1,164ms)  : 1108, 1219
     .   : milestone, 1164,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (277ms)  : 273, 281
     .   : milestone, 277,
    master - mean (278ms)  : 273, 283
     .   : milestone, 278,

    section Baseline
    This PR (7696) - mean (277ms)  : 272, 282
     .   : milestone, 277,
    master - mean (276ms)  : 271, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (940ms)  : 887, 993
     .   : milestone, 940,
    master - mean (944ms)  : 905, 982
     .   : milestone, 944,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (271ms)  : 266, 276
     .   : milestone, 271,
    master - mean (270ms)  : 266, 274
     .   : milestone, 270,

    section Baseline
    This PR (7696) - mean (272ms)  : 265, 280
     .   : milestone, 272,
    master - mean (270ms)  : 266, 273
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (920ms)  : 868, 973
     .   : milestone, 920,
    master - mean (926ms)  : 881, 971
     .   : milestone, 926,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7696) - mean (270ms)  : 265, 275
     .   : milestone, 270,
    master - mean (270ms)  : 266, 273
     .   : milestone, 270,

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

    section CallTarget+Inlining+NGEN
    This PR (7696) - mean (851ms)  : 829, 873
     .   : milestone, 851,
    master - mean (857ms)  : 836, 878
     .   : milestone, 857,

Loading

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Oct 22, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

IpcClientTest from Datadog.Trace.Tests.Ci.Ipc.IpcTests (Datadog)
Expected finalValue.ClientValue to be 20, but found 19 (difference of -1).

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7f291f3 | Docs | Was this helpful? Give us feedback!

@gleocadie gleocadie force-pushed the gleocadie/cleanup-there-and-there branch from 06da7e6 to 7f291f3 Compare October 23, 2025 10:15
Copy link
Contributor

@chrisnas chrisnas left a comment

Choose a reason for hiding this comment

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

LGTM

@gleocadie gleocadie merged commit bf7aead into master Oct 24, 2025
156 of 158 checks passed
@gleocadie gleocadie deleted the gleocadie/cleanup-there-and-there branch October 24, 2025 13:02
@github-actions github-actions bot added this to the vNext-v3 milestone Oct 24, 2025
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.

2 participants