-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy initialize the AggregatedMetrics
.
#4602
Conversation
tracer/src/Datadog.Trace/Telemetry/Collectors/MetricsTelemetryCollector.cs
Outdated
Show resolved
Hide resolved
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:
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 (4602) - mean (75ms) : 63, 87
. : milestone, 75,
master - mean (70ms) : 61, 79
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (4602) - mean (1,015ms) : 962, 1069
. : milestone, 1015,
master - mean (1,023ms) : 980, 1067
. : milestone, 1023,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4602) - mean (107ms) : 95, 119
. : milestone, 107,
master - mean (106ms) : 97, 116
. : milestone, 106,
section CallTarget+Inlining+NGEN
This PR (4602) - mean (695ms) : 662, 728
. : milestone, 695,
master - mean (700ms) : 675, 725
. : milestone, 700,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4602) - mean (90ms) : 83, 97
. : milestone, 90,
master - mean (89ms) : 87, 92
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (4602) - mean (661ms) : 625, 697
. : milestone, 661,
master - mean (669ms) : 633, 705
. : milestone, 669,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4602) - mean (190ms) : 184, 196
. : milestone, 190,
master - mean (189ms) : 182, 195
. : milestone, 189,
section CallTarget+Inlining+NGEN
This PR (4602) - mean (1,088ms) : 1036, 1141
. : milestone, 1088,
master - mean (1,103ms) : 1067, 1139
. : milestone, 1103,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4602) - mean (273ms) : 266, 280
. : milestone, 273,
master - mean (270ms) : 262, 278
. : milestone, 270,
section CallTarget+Inlining+NGEN
This PR (4602) - mean (1,053ms) : 1014, 1091
. : milestone, 1053,
master - mean (1,057ms) : 1017, 1097
. : milestone, 1057,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (4602) - mean (284ms) : 218, 349
. : milestone, 284,
master - mean (258ms) : 248, 269
. : milestone, 258,
section CallTarget+Inlining+NGEN
This PR (4602) - mean (1,004ms) : 965, 1042
. : milestone, 1004,
master - mean (1,012ms) : 968, 1055
. : milestone, 1012,
|
Benchmarks Report 🐌Benchmarks for #4602 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.343 | 489.31 | 656.98 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 | 1.140 | 610.97 | 536.02 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 464ns | 0.13ns | 0.505ns | 0.00746 | 0 | 0 | 536 B |
master | StartFinishSpan |
netcoreapp3.1 | 609ns | 1.32ns | 5.1ns | 0.00733 | 0 | 0 | 536 B |
master | StartFinishSpan |
net472 | 607ns | 0.133ns | 0.479ns | 0.0854 | 0 | 0 | 538 B |
master | StartFinishScope |
net6.0 | 489ns | 0.136ns | 0.509ns | 0.00925 | 0 | 0 | 656 B |
master | StartFinishScope |
netcoreapp3.1 | 715ns | 0.313ns | 1.13ns | 0.00898 | 0 | 0 | 656 B |
master | StartFinishScope |
net472 | 838ns | 0.277ns | 0.998ns | 0.0979 | 0 | 0 | 618 B |
#4602 | StartFinishSpan |
net6.0 | 450ns | 0.112ns | 0.418ns | 0.00754 | 0 | 0 | 536 B |
#4602 | StartFinishSpan |
netcoreapp3.1 | 536ns | 0.258ns | 0.966ns | 0.00721 | 0 | 0 | 536 B |
#4602 | StartFinishSpan |
net472 | 666ns | 0.378ns | 1.46ns | 0.0852 | 0 | 0 | 538 B |
#4602 | StartFinishScope |
net6.0 | 657ns | 0.215ns | 0.834ns | 0.00925 | 0 | 0 | 656 B |
#4602 | StartFinishScope |
netcoreapp3.1 | 664ns | 0.231ns | 0.799ns | 0.00872 | 0 | 0 | 656 B |
#4602 | StartFinishScope |
net472 | 805ns | 0.451ns | 1.75ns | 0.098 | 0 | 0 | 618 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #4602
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472
1.119
1,060.73
948.10
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 | 1.119 | 1,060.73 | 948.10 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 558ns | 0.13ns | 0.487ns | 0.00922 | 0 | 0 | 656 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 800ns | 0.342ns | 1.33ns | 0.00874 | 0 | 0 | 656 B |
master | RunOnMethodBegin |
net472 | 1.06μs | 0.356ns | 1.38ns | 0.0978 | 0 | 0 | 618 B |
#4602 | RunOnMethodBegin |
net6.0 | 594ns | 0.181ns | 0.7ns | 0.00918 | 0 | 0 | 656 B |
#4602 | RunOnMethodBegin |
netcoreapp3.1 | 825ns | 0.258ns | 0.966ns | 0.00904 | 0 | 0 | 656 B |
#4602 | RunOnMethodBegin |
net472 | 948ns | 0.317ns | 1.23ns | 0.0981 | 0 | 0 | 618 B |
Datadog ReportBranch report: ✅ |
Throughput/Crank Report:zap:Throughput results for AspNetCoreSimpleController comparing the following branches/commits: Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red. Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards! gantt
title Throughput Linux x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4602) (11.225M) : 0, 11224517
master (11.190M) : 0, 11190428
benchmarks/2.37.0 (11.539M) : 0, 11539240
benchmarks/2.9.0 (11.212M) : 0, 11211637
section Automatic
This PR (4602) (7.817M) : 0, 7816731
master (7.830M) : 0, 7829725
benchmarks/2.37.0 (7.743M) : 0, 7743046
benchmarks/2.9.0 (8.139M) : 0, 8139111
section Trace stats
master (7.824M) : 0, 7824456
benchmarks/2.37.0 (7.822M) : 0, 7822046
section Manual
This PR (4602) (9.977M) : 0, 9976999
master (9.958M) : 0, 9957707
benchmarks/2.37.0 (9.930M) : 0, 9930410
section Manual + Automatic
This PR (4602) (7.492M) : 0, 7491961
master (7.503M) : 0, 7502753
benchmarks/2.37.0 (7.420M) : 0, 7419660
section Version Conflict
master (6.780M) : 0, 6779967
benchmarks/2.37.0 (6.715M) : 0, 6714611
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4602) (9.746M) : 0, 9746108
master (9.257M) : 0, 9256536
benchmarks/2.37.0 (9.762M) : 0, 9762293
benchmarks/2.9.0 (9.520M) : 0, 9520167
section Automatic
This PR (4602) (6.735M) : 0, 6735265
master (6.679M) : 0, 6679060
benchmarks/2.37.0 (6.804M) : 0, 6804305
section Trace stats
master (6.785M) : 0, 6785175
benchmarks/2.37.0 (6.664M) : 0, 6663814
section Manual
This PR (4602) (8.546M) : 0, 8546202
master (8.687M) : 0, 8686994
benchmarks/2.37.0 (8.413M) : 0, 8412763
section Manual + Automatic
This PR (4602) (6.575M) : 0, 6575060
master (6.493M) : 0, 6492737
benchmarks/2.37.0 (6.481M) : 0, 6480877
section Version Conflict
master (5.875M) : 0, 5874843
benchmarks/2.37.0 (5.967M) : 0, 5967147
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4602) (10.250M) : 0, 10250373
master (10.281M) : 0, 10281269
benchmarks/2.37.0 (10.740M) : 0, 10739727
benchmarks/2.9.0 (10.546M) : 0, 10546222
section Automatic
This PR (4602) (7.403M) : 0, 7402860
master (7.576M) : 0, 7575616
benchmarks/2.37.0 (7.737M) : 0, 7737095
benchmarks/2.9.0 (7.729M) : 0, 7728832
section Trace stats
master (7.240M) : 0, 7239702
benchmarks/2.37.0 (7.556M) : 0, 7556168
section Manual
This PR (4602) (9.359M) : 0, 9359348
master (9.199M) : 0, 9198947
benchmarks/2.37.0 (9.693M) : 0, 9693280
section Manual + Automatic
This PR (4602) (7.301M) : 0, 7300740
master (7.133M) : 0, 7132686
benchmarks/2.37.0 (7.343M) : 0, 7343098
section Version Conflict
master (6.756M) : 0, 6755701
benchmarks/2.37.0 (6.804M) : 0, 6803632
gantt
title Throughput Linux x64 (ASM) (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (4602) (6.969M) : 0, 6969241
master (7.057M) : 0, 7056686
benchmarks/2.37.0 (7.625M) : 0, 7624599
benchmarks/2.9.0 (7.810M) : 0, 7809514
section No attack
This PR (4602) (2.058M) : 0, 2057509
master (2.050M) : 0, 2049627
benchmarks/2.37.0 (2.206M) : 0, 2206160
benchmarks/2.9.0 (3.318M) : 0, 3317796
section Attack
This PR (4602) (1.639M) : 0, 1638505
master (1.623M) : 0, 1623242
benchmarks/2.37.0 (1.704M) : 0, 1703946
benchmarks/2.9.0 (2.513M) : 0, 2512948
section Blocking
This PR (4602) (2.971M) : 0, 2970870
master (2.984M) : 0, 2983775
benchmarks/2.37.0 (3.186M) : 0, 3185505
|
This removes the allocation of the metric tags from the immediate startup path, and delays it till the first aggregation (10s later).
7ac7f5b
to
c022db3
Compare
Summary of changes
Removes the allocation of the metric tags array from the immediate startup path, and delays it till the first aggregation (10s later).
Reason for change
Tony was sad about startup allocations
Implementation details
Lazy<T>
FTWTest coverage
Nah, YOLO