Skip to content

Conversation

@andrewlock
Copy link
Member

Summary of changes

  • Unify multiple similar workflows
  • Add an action that will suggest the changes on the PR

Reason for change

We're currently building the tracer multiple times in different actions which is a bit excessive in terms of resource usage. We're also building the native components which isn't necessary (and slow).

Adding the suggested changes means that you don't have to run all this again locally just to commit the changes that it knows it needs

Implementation details

Cut, paste, and add a new action

Test coverage

This PR is the test

Other details

I think we could/should consider removing the "regenerate solution" from BuildTracerHome after this, as it removes a big part of the friction (and is annoyingly slow, at the start of a build)

… code (we don't need it) and add an action that posts suggestions to the PR
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Please commit the suggested auto-generated changes

@andrewlock
Copy link
Member Author

andrewlock commented Mar 12, 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.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6762) - mean (70ms)  : 65, 76
     .   : milestone, 70,
    master - mean (70ms)  : 66, 73
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (6762) - mean (1,012ms)  : 987, 1037
     .   : milestone, 1012,
    master - mean (1,015ms)  : 992, 1037
     .   : milestone, 1015,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6762) - mean (102ms)  : 101, 104
     .   : milestone, 102,
    master - mean (103ms)  : 101, 105
     .   : milestone, 103,

    section CallTarget+Inlining+NGEN
    This PR (6762) - mean (688ms)  : 671, 706
     .   : milestone, 688,
    master - mean (688ms)  : 668, 709
     .   : milestone, 688,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6762) - mean (89ms)  : 87, 91
     .   : milestone, 89,
    master - mean (90ms)  : 88, 91
     .   : milestone, 90,

    section CallTarget+Inlining+NGEN
    This PR (6762) - mean (639ms)  : 618, 660
     .   : milestone, 639,
    master - mean (645ms)  : 629, 661
     .   : milestone, 645,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6762) - mean (190ms)  : 185, 195
     .   : milestone, 190,
    master - mean (190ms)  : 185, 194
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6762) - mean (1,105ms)  : 1075, 1136
     .   : milestone, 1105,
    master - mean (1,104ms)  : 1080, 1128
     .   : milestone, 1104,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6762) - mean (268ms)  : 264, 272
     .   : milestone, 268,
    master - mean (269ms)  : 265, 273
     .   : milestone, 269,

    section CallTarget+Inlining+NGEN
    This PR (6762) - mean (872ms)  : 849, 895
     .   : milestone, 872,
    master - mean (875ms)  : 845, 906
     .   : milestone, 875,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6762) - mean (261ms)  : 257, 265
     .   : milestone, 261,
    master - mean (261ms)  : 258, 265
     .   : milestone, 261,

    section CallTarget+Inlining+NGEN
    This PR (6762) - mean (851ms)  : 824, 879
     .   : milestone, 851,
    master - mean (857ms)  : 822, 893
     .   : milestone, 857,

Loading

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 12, 2025

Datadog Report

Branch report: andrew/ci/suggest-changes
Commit report: e8c1afa
Test service: dd-trace-dotnet

✅ 0 Failed, 246374 Passed, 2039 Skipped, 14h 0m 41.79s Total Time

@andrewlock
Copy link
Member Author

andrewlock commented Mar 12, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6762 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.124
  • 1 benchmarks are slower, with geometric mean 1.149
  • All benchmarks have the same 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 8.08μs 45.8ns 318ns 0.0116 0.00387 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 54ns 275ns 0.0147 0.0049 0 5.8 KB
master StartStopWithChild net472 16μs 32.4ns 125ns 1.04 0.302 0.0953 6.21 KB
#6762 StartStopWithChild net6.0 8.16μs 43.7ns 240ns 0.017 0.00851 0 5.61 KB
#6762 StartStopWithChild netcoreapp3.1 10.2μs 57.1ns 366ns 0.0249 0.00997 0 5.8 KB
#6762 StartStopWithChild net472 16.1μs 41.8ns 162ns 1.03 0.289 0.0964 6.21 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 502μs 532ns 2.06μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 706ns 2.73μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 845μs 877ns 3.4μs 0.422 0 0 3.3 KB
#6762 WriteAndFlushEnrichedTraces net6.0 496μs 791ns 3.06μs 0 0 0 2.7 KB
#6762 WriteAndFlushEnrichedTraces netcoreapp3.1 710μs 824ns 3.19μs 0 0 0 2.7 KB
#6762 WriteAndFlushEnrichedTraces net472 865μs 411ns 1.59μs 0.437 0 0 3.3 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 135μs 287ns 1.07μs 0.134 0 0 14.47 KB
master SendRequest netcoreapp3.1 149μs 258ns 997ns 0.223 0 0 17.27 KB
master SendRequest net472 0.00108ns 0.000391ns 0.00146ns 0 0 0 0 b
#6762 SendRequest net6.0 134μs 699ns 3.28μs 0.138 0 0 14.47 KB
#6762 SendRequest netcoreapp3.1 149μs 257ns 995ns 0.222 0 0 17.27 KB
#6762 SendRequest net472 0.000199ns 0.000109ns 0.000422ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 567μs 2.67μs 10.3μs 0.566 0 0 41.66 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 693μs 3.73μs 21.7μs 0.361 0 0 41.7 KB
master WriteAndFlushEnrichedTraces net472 845μs 3.86μs 14.9μs 8.81 2.52 0.419 53.31 KB
#6762 WriteAndFlushEnrichedTraces net6.0 587μs 3.27μs 20.4μs 0.604 0 0 41.54 KB
#6762 WriteAndFlushEnrichedTraces netcoreapp3.1 778μs 4.6μs 45.6μs 0.372 0 0 41.55 KB
#6762 WriteAndFlushEnrichedTraces net472 856μs 3.82μs 14.8μs 8.39 2.52 0.419 53.3 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.41μs 2.29ns 8.88ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.8μs 1.48ns 5.52ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 2.2μs 2.86ns 11.1ns 0.156 0.00109 0 987 B
#6762 ExecuteNonQuery net6.0 1.32μs 2.08ns 8.07ns 0.0143 0 0 1.02 KB
#6762 ExecuteNonQuery netcoreapp3.1 1.77μs 2.01ns 7.79ns 0.0133 0 0 1.02 KB
#6762 ExecuteNonQuery net472 2.1μs 3.29ns 12.8ns 0.156 0.00105 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.25μs 1.05ns 3.77ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.58μs 1.17ns 4.51ns 0.0125 0 0 976 B
master CallElasticsearch net472 2.62μs 2.15ns 8.32ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.32μs 0.874ns 3.39ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.7μs 0.724ns 2.8ns 0.0136 0 0 1.02 KB
master CallElasticsearchAsync net472 2.64μs 3.54ns 13.7ns 0.166 0 0 1.05 KB
#6762 CallElasticsearch net6.0 1.24μs 0.683ns 2.55ns 0.0132 0 0 976 B
#6762 CallElasticsearch netcoreapp3.1 1.59μs 1.01ns 3.91ns 0.0128 0 0 976 B
#6762 CallElasticsearch net472 2.63μs 1.65ns 6.16ns 0.157 0 0 995 B
#6762 CallElasticsearchAsync net6.0 1.35μs 0.798ns 2.99ns 0.0135 0 0 952 B
#6762 CallElasticsearchAsync netcoreapp3.1 1.66μs 0.692ns 2.59ns 0.0141 0 0 1.02 KB
#6762 CallElasticsearchAsync net472 2.67μs 2.03ns 7.85ns 0.167 0 0 1.05 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.36μs 3.04ns 11.8ns 0.0136 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.66μs 0.994ns 3.72ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.81μs 0.574ns 2.15ns 0.145 0 0 915 B
#6762 ExecuteAsync net6.0 1.22μs 1ns 3.88ns 0.0135 0 0 952 B
#6762 ExecuteAsync netcoreapp3.1 1.64μs 0.948ns 3.55ns 0.0131 0 0 952 B
#6762 ExecuteAsync net472 1.85μs 0.6ns 2.32ns 0.145 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 4.35μs 1.86ns 6.95ns 0.0325 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.5μs 1.92ns 7.44ns 0.0384 0 0 2.85 KB
master SendAsync net472 7.48μs 1.81ns 7ns 0.494 0 0 3.12 KB
#6762 SendAsync net6.0 4.6μs 1.38ns 5.35ns 0.0322 0 0 2.31 KB
#6762 SendAsync netcoreapp3.1 5.41μs 2.22ns 8.59ns 0.0379 0 0 2.85 KB
#6762 SendAsync net472 7.36μs 2.18ns 8.46ns 0.496 0 0 3.12 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 1.5μs 0.728ns 2.73ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.42μs 1.2ns 4.63ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.42μs 0.772ns 2.99ns 0.249 0 0 1.57 KB
#6762 EnrichedLog net6.0 1.45μs 0.737ns 2.76ns 0.0232 0 0 1.64 KB
#6762 EnrichedLog netcoreapp3.1 2.29μs 1.28ns 4.79ns 0.0218 0 0 1.64 KB
#6762 EnrichedLog net472 2.57μs 0.903ns 3.38ns 0.25 0 0 1.57 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 111μs 158ns 593ns 0.055 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 117μs 198ns 767ns 0 0 0 4.28 KB
master EnrichedLog net472 149μs 153ns 591ns 0.67 0.223 0 4.46 KB
#6762 EnrichedLog net6.0 112μs 164ns 634ns 0.056 0 0 4.28 KB
#6762 EnrichedLog netcoreapp3.1 117μs 139ns 537ns 0.0593 0 0 4.28 KB
#6762 EnrichedLog net472 152μs 220ns 850ns 0.678 0.226 0 4.46 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 3μs 0.605ns 2.26ns 0.03 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.29μs 3.24ns 12.5ns 0.03 0 0 2.2 KB
master EnrichedLog net472 4.83μs 1.47ns 5.71ns 0.321 0 0 2.02 KB
#6762 EnrichedLog net6.0 3.05μs 1.1ns 4.27ns 0.0305 0 0 2.2 KB
#6762 EnrichedLog netcoreapp3.1 4.31μs 2.56ns 9.9ns 0.0284 0 0 2.2 KB
#6762 EnrichedLog net472 4.81μs 7.68ns 29.8ns 0.321 0 0 2.02 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.35μs 0.731ns 2.83ns 0.0156 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.79μs 1.35ns 5.23ns 0.0152 0 0 1.14 KB
master SendReceive net472 2.09μs 1ns 3.88ns 0.183 0 0 1.16 KB
#6762 SendReceive net6.0 1.31μs 0.784ns 3.04ns 0.0157 0 0 1.14 KB
#6762 SendReceive netcoreapp3.1 1.82μs 0.951ns 3.68ns 0.0156 0 0 1.14 KB
#6762 SendReceive net472 2.07μs 0.681ns 2.64ns 0.183 0 0 1.16 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 2.77μs 1.32ns 4.95ns 0.0222 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.89μs 4.18ns 16.2ns 0.0213 0 0 1.65 KB
master EnrichedLog net472 4.43μs 1.91ns 7.4ns 0.323 0 0 2.04 KB
#6762 EnrichedLog net6.0 2.82μs 0.725ns 2.61ns 0.0224 0 0 1.6 KB
#6762 EnrichedLog netcoreapp3.1 3.94μs 1.23ns 4.61ns 0.0217 0 0 1.65 KB
#6762 EnrichedLog net472 4.25μs 7.78ns 30.1ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6762

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.149 484.23 556.43

Faster 🎉 in #6762

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.124 454.86 404.68

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 455ns 0.131ns 0.506ns 0.00803 0 0 576 B
master StartFinishSpan netcoreapp3.1 595ns 0.381ns 1.48ns 0.00772 0 0 576 B
master StartFinishSpan net472 688ns 1.76ns 6.8ns 0.0918 0 0 578 B
master StartFinishScope net6.0 484ns 0.0714ns 0.277ns 0.00988 0 0 696 B
master StartFinishScope netcoreapp3.1 776ns 0.455ns 1.76ns 0.00936 0 0 696 B
master StartFinishScope net472 850ns 0.291ns 1.13ns 0.104 0 0 658 B
#6762 StartFinishSpan net6.0 405ns 0.135ns 0.506ns 0.0081 0 0 576 B
#6762 StartFinishSpan netcoreapp3.1 576ns 2.29ns 8.86ns 0.00764 0 0 576 B
#6762 StartFinishSpan net472 653ns 0.227ns 0.85ns 0.0915 0 0 578 B
#6762 StartFinishScope net6.0 556ns 0.14ns 0.542ns 0.00968 0 0 696 B
#6762 StartFinishScope netcoreapp3.1 741ns 0.131ns 0.492ns 0.00928 0 0 696 B
#6762 StartFinishScope net472 828ns 0.253ns 0.978ns 0.105 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 654ns 0.411ns 1.48ns 0.0098 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 943ns 1.32ns 5.12ns 0.00899 0 0 696 B
master RunOnMethodBegin net472 1.12μs 0.417ns 1.62ns 0.104 0 0 658 B
#6762 RunOnMethodBegin net6.0 642ns 0.373ns 1.29ns 0.00958 0 0 696 B
#6762 RunOnMethodBegin netcoreapp3.1 977ns 3.19ns 12.3ns 0.00963 0 0 696 B
#6762 RunOnMethodBegin net472 1.17μs 0.246ns 0.887ns 0.104 0 0 658 B

@DataDog DataDog deleted a comment from github-actions bot Mar 13, 2025
@andrewlock andrewlock force-pushed the andrew/ci/suggest-changes branch from 180c2a5 to 20146dc Compare March 13, 2025 09:33
@andrewlock andrewlock force-pushed the andrew/ci/suggest-changes branch from 20146dc to e8c1afa Compare March 13, 2025 11:09
@andrewlock andrewlock closed this Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants