-
Notifications
You must be signed in to change notification settings - Fork 140
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
[Profiler] Use a homemade implementation of linked-list #5284
[Profiler] Use a homemade implementation of linked-list #5284
Conversation
190bd2b
to
c563272
Compare
Datadog ReportBranch report: ✅ 0 Failed, 329328 Passed, 1861 Skipped, 35m 31.12s Wall Time New Flaky Tests (1)
|
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 (5284) - mean (74ms) : 65, 84
. : milestone, 74,
master - mean (73ms) : 65, 81
. : milestone, 73,
section CallTarget+Inlining+NGEN
This PR (5284) - mean (1,011ms) : 989, 1033
. : milestone, 1011,
master - mean (1,005ms) : 977, 1033
. : milestone, 1005,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5284) - mean (111ms) : 108, 114
. : milestone, 111,
master - mean (110ms) : 107, 114
. : milestone, 110,
section CallTarget+Inlining+NGEN
This PR (5284) - mean (725ms) : 700, 749
. : milestone, 725,
master - mean (725ms) : 703, 748
. : milestone, 725,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5284) - mean (95ms) : 92, 98
. : milestone, 95,
master - mean (93ms) : 91, 96
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (5284) - mean (680ms) : 649, 711
. : milestone, 680,
master - mean (675ms) : 652, 698
. : milestone, 675,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5284) - mean (188ms) : 185, 191
. : milestone, 188,
master - mean (188ms) : 185, 192
. : milestone, 188,
section CallTarget+Inlining+NGEN
This PR (5284) - mean (1,081ms) : 1057, 1106
. : milestone, 1081,
master - mean (1,075ms) : 1047, 1104
. : milestone, 1075,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5284) - mean (272ms) : 268, 276
. : milestone, 272,
master - mean (272ms) : 268, 276
. : milestone, 272,
section CallTarget+Inlining+NGEN
This PR (5284) - mean (881ms) : 858, 903
. : milestone, 881,
master - mean (883ms) : 856, 909
. : milestone, 883,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5284) - mean (261ms) : 257, 266
. : milestone, 261,
master - mean (261ms) : 257, 265
. : milestone, 261,
section CallTarget+Inlining+NGEN
This PR (5284) - mean (858ms) : 835, 880
. : milestone, 858,
master - mean (855ms) : 830, 880
. : milestone, 855,
|
e9d9646
to
5f125a2
Compare
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 (5284) (11.219M) : 0, 11218526
master (11.301M) : 0, 11301171
benchmarks/2.9.0 (10.912M) : 0, 10912209
section Automatic
This PR (5284) (7.767M) : 0, 7766653
master (7.786M) : 0, 7786387
benchmarks/2.9.0 (8.150M) : 0, 8149943
section Trace stats
This PR (5284) (8.058M) : 0, 8058458
master (8.162M) : 0, 8161989
section Manual
This PR (5284) (9.844M) : 0, 9843651
master (9.926M) : 0, 9926297
section Manual + Automatic
This PR (5284) (7.316M) : 0, 7315638
master (7.412M) : 0, 7411648
section Version Conflict
This PR (5284) (6.604M) : 0, 6603824
master (6.730M) : 0, 6730224
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (5284) (9.412M) : 0, 9412460
master (9.529M) : 0, 9529282
benchmarks/2.9.0 (9.446M) : 0, 9446328
section Automatic
This PR (5284) (6.671M) : 0, 6670905
master (6.506M) : 0, 6505611
section Trace stats
This PR (5284) (6.795M) : 0, 6795071
master (6.940M) : 0, 6940301
section Manual
This PR (5284) (8.406M) : 0, 8405929
master (8.383M) : 0, 8383218
section Manual + Automatic
This PR (5284) (6.204M) : 0, 6204136
master (6.263M) : 0, 6262794
section Version Conflict
This PR (5284) (5.771M) : 0, 5770660
master (5.698M) : 0, 5698114
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (5284) (10.482M) : 0, 10481888
master (10.221M) : 0, 10221490
benchmarks/2.9.0 (10.227M) : 0, 10226734
section Automatic
This PR (5284) (7.315M) : 0, 7314813
master (7.341M) : 0, 7340809
benchmarks/2.9.0 (7.735M) : 0, 7734705
section Trace stats
This PR (5284) (7.653M) : 0, 7652770
master (7.697M) : 0, 7697428
section Manual
This PR (5284) (9.254M) : 0, 9253805
master (9.139M) : 0, 9138836
section Manual + Automatic
This PR (5284) (7.040M) : 0, 7040073
master (7.059M) : 0, 7058587
section Version Conflict
This PR (5284) (6.401M) : 0, 6400614
master (6.504M) : 0, 6503694
gantt
title Throughput Linux x64 (ASM) (Total requests)
dateFormat X
axisFormat %s
section Baseline
master (7.461M) : 0, 7461396
benchmarks/2.9.0 (7.826M) : 0, 7826159
section No attack
master (1.854M) : 0, 1853890
benchmarks/2.9.0 (3.248M) : 0, 3247998
section Attack
master (1.450M) : 0, 1449724
benchmarks/2.9.0 (2.477M) : 0, 2477217
section Blocking
master (3.161M) : 0, 3160542
section IAST default
master (6.464M) : 0, 6464188
section IAST full
master (5.600M) : 0, 5600403
section Base vuln
master (0.918M) : 0, 917723
section IAST vuln
master (0.859M) : 0, 859223
|
5f125a2
to
cd3c579
Compare
f61e9f6
to
9397f9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a couple of comments
9397f9a
to
37d6a43
Compare
Datadog ReportBranch report: ✅ 0 Failed, 322572 Passed, 1822 Skipped, 54m 17.48s Wall Time |
Benchmarks Report for tracer 🐌Benchmarks for #5284 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.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 - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 | 1.139 | 1,258.38 | 1,433.23 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteAsync |
net6.0 | 1.26μs | 1.14ns | 4.27ns | 0.0128 | 0 | 0 | 928 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.65μs | 1.84ns | 7.11ns | 0.0124 | 0 | 0 | 928 B |
master | ExecuteAsync |
net472 | 1.94μs | 1.55ns | 6.02ns | 0.141 | 0 | 0 | 891 B |
#5284 | ExecuteAsync |
net6.0 | 1.43μs | 0.561ns | 2.1ns | 0.0129 | 0 | 0 | 928 B |
#5284 | ExecuteAsync |
netcoreapp3.1 | 1.67μs | 1.83ns | 6.84ns | 0.0124 | 0 | 0 | 928 B |
#5284 | ExecuteAsync |
net472 | 1.9μs | 1.53ns | 5.91ns | 0.141 | 0 | 0 | 891 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.18μs | 2.34ns | 9.06ns | 0.0294 | 0 | 0 | 2.16 KB |
master | SendAsync |
netcoreapp3.1 | 5.06μs | 4.51ns | 17.5ns | 0.0355 | 0 | 0 | 2.7 KB |
master | SendAsync |
net472 | 7.65μs | 7.64ns | 29.6ns | 0.483 | 0 | 0 | 3.05 KB |
#5284 | SendAsync |
net6.0 | 4.08μs | 2.02ns | 7.83ns | 0.0287 | 0 | 0 | 2.16 KB |
#5284 | SendAsync |
netcoreapp3.1 | 5.08μs | 4.28ns | 16.6ns | 0.0353 | 0 | 0 | 2.7 KB |
#5284 | SendAsync |
net472 | 7.74μs | 3.91ns | 15.1ns | 0.483 | 0 | 0 | 3.05 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.55μs | 0.638ns | 2.39ns | 0.0232 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.3μs | 1.22ns | 4.55ns | 0.0219 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 2.74μs | 1.28ns | 4.81ns | 0.249 | 0 | 0 | 1.57 KB |
#5284 | EnrichedLog |
net6.0 | 1.58μs | 0.355ns | 1.23ns | 0.0234 | 0 | 0 | 1.65 KB |
#5284 | EnrichedLog |
netcoreapp3.1 | 2.32μs | 0.959ns | 3.71ns | 0.0218 | 0 | 0 | 1.65 KB |
#5284 | EnrichedLog |
net472 | 2.84μs | 1.42ns | 5.11ns | 0.249 | 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 | 87.2ns | 338ns | 0.0556 | 0 | 0 | 4.23 KB |
master | EnrichedLog |
netcoreapp3.1 | 118μs | 195ns | 755ns | 0.0587 | 0 | 0 | 4.23 KB |
master | EnrichedLog |
net472 | 147μs | 69.3ns | 268ns | 0.658 | 0.219 | 0 | 4.41 KB |
#5284 | EnrichedLog |
net6.0 | 111μs | 62.2ns | 241ns | 0.056 | 0 | 0 | 4.23 KB |
#5284 | EnrichedLog |
netcoreapp3.1 | 117μs | 120ns | 448ns | 0 | 0 | 0 | 4.23 KB |
#5284 | EnrichedLog |
net472 | 147μs | 108ns | 403ns | 0.66 | 0.22 | 0 | 4.41 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.11μs | 2.52ns | 9.42ns | 0.0311 | 0 | 0 | 2.21 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.94μs | 3.78ns | 14.1ns | 0.0294 | 0 | 0 | 2.21 KB |
master | EnrichedLog |
net472 | 4.94μs | 4.28ns | 16.6ns | 0.319 | 0 | 0 | 2.02 KB |
#5284 | EnrichedLog |
net6.0 | 2.87μs | 1.3ns | 5.02ns | 0.0316 | 0 | 0 | 2.21 KB |
#5284 | EnrichedLog |
netcoreapp3.1 | 4.01μs | 2.06ns | 7.44ns | 0.0305 | 0 | 0 | 2.21 KB |
#5284 | EnrichedLog |
net472 | 4.9μs | 1.5ns | 5.82ns | 0.319 | 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.43μs | 3.14ns | 11.7ns | 0.0163 | 0 | 0 | 1.18 KB |
master | SendReceive |
netcoreapp3.1 | 1.86μs | 1.73ns | 6.23ns | 0.0159 | 0 | 0 | 1.18 KB |
master | SendReceive |
net472 | 2.21μs | 2.53ns | 9.78ns | 0.187 | 0 | 0 | 1.18 KB |
#5284 | SendReceive |
net6.0 | 1.44μs | 0.687ns | 2.57ns | 0.0165 | 0 | 0 | 1.18 KB |
#5284 | SendReceive |
netcoreapp3.1 | 1.88μs | 1.18ns | 4.58ns | 0.016 | 0 | 0 | 1.18 KB |
#5284 | SendReceive |
net472 | 2.29μs | 2.51ns | 9.07ns | 0.187 | 0 | 0 | 1.18 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.87μs | 0.754ns | 2.92ns | 0.0213 | 0 | 0 | 1.55 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.94μs | 2.29ns | 8.87ns | 0.0218 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
net472 | 4.39μs | 3.15ns | 12.2ns | 0.315 | 0 | 0 | 1.99 KB |
#5284 | EnrichedLog |
net6.0 | 2.84μs | 1.14ns | 4.43ns | 0.0215 | 0 | 0 | 1.55 KB |
#5284 | EnrichedLog |
netcoreapp3.1 | 3.96μs | 1.29ns | 4.48ns | 0.022 | 0 | 0 | 1.6 KB |
#5284 | EnrichedLog |
net472 | 4.42μs | 3.33ns | 12.9ns | 0.315 | 0 | 0 | 1.99 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 | 506ns | 0.546ns | 2.12ns | 0.00775 | 0 | 0 | 552 B |
master | StartFinishSpan |
netcoreapp3.1 | 714ns | 1.91ns | 7.41ns | 0.00745 | 0 | 0 | 552 B |
master | StartFinishSpan |
net472 | 779ns | 2.13ns | 8.27ns | 0.0876 | 0 | 0 | 554 B |
master | StartFinishScope |
net6.0 | 628ns | 0.945ns | 3.66ns | 0.00945 | 0 | 0 | 672 B |
master | StartFinishScope |
netcoreapp3.1 | 868ns | 1.64ns | 6.36ns | 0.00911 | 0 | 0 | 672 B |
master | StartFinishScope |
net472 | 990ns | 1.52ns | 5.69ns | 0.101 | 0 | 0 | 634 B |
#5284 | StartFinishSpan |
net6.0 | 485ns | 0.853ns | 3.3ns | 0.00783 | 0 | 0 | 552 B |
#5284 | StartFinishSpan |
netcoreapp3.1 | 722ns | 0.625ns | 2.16ns | 0.00755 | 0 | 0 | 552 B |
#5284 | StartFinishSpan |
net472 | 806ns | 2.01ns | 7.77ns | 0.088 | 0 | 0 | 554 B |
#5284 | StartFinishScope |
net6.0 | 689ns | 0.431ns | 1.67ns | 0.00933 | 0 | 0 | 672 B |
#5284 | StartFinishScope |
netcoreapp3.1 | 859ns | 2.52ns | 9.74ns | 0.00924 | 0 | 0 | 672 B |
#5284 | StartFinishScope |
net472 | 1.02μs | 0.421ns | 1.63ns | 0.1 | 0 | 0 | 634 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 | 663ns | 0.83ns | 3.22ns | 0.00962 | 0 | 0 | 672 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 1.02μs | 1.54ns | 5.77ns | 0.0089 | 0 | 0 | 672 B |
master | RunOnMethodBegin |
net472 | 1.11μs | 1.83ns | 6.84ns | 0.1 | 0 | 0 | 634 B |
#5284 | RunOnMethodBegin |
net6.0 | 681ns | 0.26ns | 1.01ns | 0.00936 | 0 | 0 | 672 B |
#5284 | RunOnMethodBegin |
netcoreapp3.1 | 935ns | 0.743ns | 2.68ns | 0.00874 | 0 | 0 | 672 B |
#5284 | RunOnMethodBegin |
net472 | 1.05μs | 1.02ns | 3.96ns | 0.1 | 0 | 0 | 634 B |
Summary of changes
Homemade implementation of a linked list.
Reason for change
We plan to use for some (maybe all) of our profilers a ring-buffer-based allocator. This allocator may return
nullptr
when there is not enough room.std::list
does not support allocators which returnsnullptr
. So we need our own implementation which allowsnullptr
to be returned.In the upper layer, this will measure (metrics, logs...)
Implementation details
LinkedList
class which takes amemory_resource
as ctor parameter. The defaultmemory_resource
isnew/delete
(same behavior as today with astd::list
). This class is move-only to simplify it's implementation (if there is a copy, we do not want to copy all the elements)std::list
inRawSamples
Test coverage
Other details