-
Notifications
You must be signed in to change notification settings - Fork 145
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
[Dynamic Instrumentation] DEBUG-3132 Add Memoization Cache for Redaction Logic #6292
base: master
Are you sure you want to change the base?
Conversation
5d8e91e
to
0052195
Compare
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 (6292) - mean (69ms) : 66, 73
. : milestone, 69,
master - mean (69ms) : 66, 73
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6292) - mean (1,001ms) : 970, 1031
. : milestone, 1001,
master - mean (996ms) : 976, 1016
. : milestone, 996,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6292) - mean (103ms) : 101, 105
. : milestone, 103,
master - mean (103ms) : 101, 105
. : milestone, 103,
section CallTarget+Inlining+NGEN
This PR (6292) - mean (672ms) : 659, 686
. : milestone, 672,
master - mean (673ms) : 655, 691
. : milestone, 673,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6292) - mean (90ms) : 89, 92
. : milestone, 90,
master - mean (90ms) : 88, 92
. : milestone, 90,
section CallTarget+Inlining+NGEN
This PR (6292) - mean (637ms) : 621, 653
. : milestone, 637,
master - mean (630ms) : 616, 644
. : milestone, 630,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6292) - mean (190ms) : 186, 193
. : milestone, 190,
master - mean (191ms) : 186, 196
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6292) - mean (1,103ms) : 1065, 1141
. : milestone, 1103,
master - mean (1,104ms) : 1070, 1138
. : milestone, 1104,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6292) - mean (269ms) : 266, 273
. : milestone, 269,
master - mean (270ms) : 265, 274
. : milestone, 270,
section CallTarget+Inlining+NGEN
This PR (6292) - mean (862ms) : 832, 892
. : milestone, 862,
master - mean (865ms) : 832, 897
. : milestone, 865,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6292) - mean (261ms) : 257, 266
. : milestone, 261,
master - mean (261ms) : 257, 265
. : milestone, 261,
section CallTarget+Inlining+NGEN
This PR (6292) - mean (845ms) : 807, 884
. : milestone, 845,
master - mean (845ms) : 814, 877
. : milestone, 845,
|
Benchmarks Report for tracer 🐌Benchmarks for #6292 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 ✔️ More allocations
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 41.66 KB | 41.92 KB | 259 B | 0.62% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | WriteAndFlushEnrichedTraces |
net6.0 | 585μs | 3.02μs | 15.4μs | 0.576 | 0 | 0 | 41.58 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 652μs | 3.57μs | 22.6μs | 0.332 | 0 | 0 | 41.66 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 839μs | 3.27μs | 12.7μs | 8.13 | 2.57 | 0.428 | 53.26 KB |
#6292 | WriteAndFlushEnrichedTraces |
net6.0 | 561μs | 1.97μs | 7.1μs | 0.536 | 0 | 0 | 41.79 KB |
#6292 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 679μs | 3.15μs | 16.7μs | 0.34 | 0 | 0 | 41.92 KB |
#6292 | WriteAndFlushEnrichedTraces |
net472 | 865μs | 4.42μs | 19.8μs | 8.45 | 2.53 | 0.422 | 53.32 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.3μs | 1.6ns | 6.19ns | 0.0142 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.73μs | 2.25ns | 8.73ns | 0.0131 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
net472 | 2.08μs | 2.41ns | 9.32ns | 0.156 | 0.00103 | 0 | 987 B |
#6292 | ExecuteNonQuery |
net6.0 | 1.28μs | 1.44ns | 5.59ns | 0.0141 | 0 | 0 | 1.02 KB |
#6292 | ExecuteNonQuery |
netcoreapp3.1 | 1.72μs | 1.28ns | 4.94ns | 0.014 | 0 | 0 | 1.02 KB |
#6292 | ExecuteNonQuery |
net472 | 2.01μs | 1.82ns | 6.82ns | 0.157 | 0.000997 | 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.29μs | 0.399ns | 1.49ns | 0.0139 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.55μs | 0.7ns | 2.71ns | 0.0133 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.53μs | 1.8ns | 6.98ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.32μs | 0.589ns | 2.21ns | 0.0132 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.69μs | 0.576ns | 2.23ns | 0.0136 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.61μs | 1.17ns | 4.55ns | 0.167 | 0 | 0 | 1.05 KB |
#6292 | CallElasticsearch |
net6.0 | 1.2μs | 0.609ns | 2.28ns | 0.0138 | 0 | 0 | 976 B |
#6292 | CallElasticsearch |
netcoreapp3.1 | 1.55μs | 0.436ns | 1.57ns | 0.0132 | 0 | 0 | 976 B |
#6292 | CallElasticsearch |
net472 | 2.64μs | 1.44ns | 5.56ns | 0.157 | 0 | 0 | 995 B |
#6292 | CallElasticsearchAsync |
net6.0 | 1.35μs | 0.638ns | 2.39ns | 0.0135 | 0 | 0 | 952 B |
#6292 | CallElasticsearchAsync |
netcoreapp3.1 | 1.67μs | 0.463ns | 1.73ns | 0.0134 | 0 | 0 | 1.02 KB |
#6292 | CallElasticsearchAsync |
net472 | 2.68μs | 1.33ns | 5.16ns | 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.35μs | 0.732ns | 2.74ns | 0.0136 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.55μs | 0.752ns | 2.61ns | 0.0133 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.89μs | 0.828ns | 3.1ns | 0.145 | 0 | 0 | 915 B |
#6292 | ExecuteAsync |
net6.0 | 1.34μs | 0.956ns | 3.58ns | 0.0132 | 0 | 0 | 952 B |
#6292 | ExecuteAsync |
netcoreapp3.1 | 1.61μs | 1.94ns | 7.27ns | 0.0124 | 0 | 0 | 952 B |
#6292 | ExecuteAsync |
net472 | 1.78μs | 0.468ns | 1.75ns | 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.37μs | 1.22ns | 4.71ns | 0.0327 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.28μs | 1.56ns | 5.85ns | 0.0397 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.32μs | 2.38ns | 8.89ns | 0.494 | 0 | 0 | 3.12 KB |
#6292 | SendAsync |
net6.0 | 4.4μs | 2.23ns | 8.33ns | 0.0309 | 0 | 0 | 2.31 KB |
#6292 | SendAsync |
netcoreapp3.1 | 5.24μs | 2.86ns | 11.1ns | 0.0368 | 0 | 0 | 2.85 KB |
#6292 | SendAsync |
net472 | 7.3μs | 2.84ns | 11ns | 0.495 | 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.48μs | 1.44ns | 5.4ns | 0.0229 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.17μs | 1.22ns | 4.57ns | 0.0229 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.52μs | 1.17ns | 4.53ns | 0.249 | 0 | 0 | 1.57 KB |
#6292 | EnrichedLog |
net6.0 | 1.57μs | 0.788ns | 2.95ns | 0.0226 | 0 | 0 | 1.64 KB |
#6292 | EnrichedLog |
netcoreapp3.1 | 2.23μs | 1.79ns | 6.69ns | 0.0212 | 0 | 0 | 1.64 KB |
#6292 | EnrichedLog |
net472 | 2.54μs | 0.88ns | 3.17ns | 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 | 57.1ns | 206ns | 0.0556 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 116μs | 161ns | 625ns | 0.0578 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 150μs | 124ns | 482ns | 0.671 | 0.224 | 0 | 4.46 KB |
#6292 | EnrichedLog |
net6.0 | 112μs | 98.6ns | 382ns | 0.0563 | 0 | 0 | 4.28 KB |
#6292 | EnrichedLog |
netcoreapp3.1 | 117μs | 114ns | 443ns | 0 | 0 | 0 | 4.28 KB |
#6292 | EnrichedLog |
net472 | 151μs | 107ns | 413ns | 0.679 | 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.03μs | 1.03ns | 3.72ns | 0.0303 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.16μs | 1.72ns | 6.68ns | 0.0294 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.78μs | 1.26ns | 4.89ns | 0.319 | 0 | 0 | 2.02 KB |
#6292 | EnrichedLog |
net6.0 | 2.97μs | 1.43ns | 5.36ns | 0.0306 | 0 | 0 | 2.2 KB |
#6292 | EnrichedLog |
netcoreapp3.1 | 4.11μs | 1.95ns | 7.54ns | 0.0285 | 0 | 0 | 2.2 KB |
#6292 | EnrichedLog |
net472 | 4.77μs | 1.39ns | 5.2ns | 0.32 | 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.42μs | 0.757ns | 2.83ns | 0.0156 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.84μs | 0.592ns | 2.29ns | 0.0149 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.06μs | 0.608ns | 2.35ns | 0.183 | 0 | 0 | 1.16 KB |
#6292 | SendReceive |
net6.0 | 1.43μs | 1.07ns | 4.16ns | 0.0162 | 0 | 0 | 1.14 KB |
#6292 | SendReceive |
netcoreapp3.1 | 1.78μs | 1.18ns | 4.56ns | 0.0149 | 0 | 0 | 1.14 KB |
#6292 | SendReceive |
net472 | 2.1μs | 0.65ns | 2.43ns | 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.83μs | 0.849ns | 3.29ns | 0.0212 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.87μs | 1.73ns | 6.72ns | 0.021 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.51μs | 1.83ns | 6.83ns | 0.322 | 0 | 0 | 2.04 KB |
#6292 | EnrichedLog |
net6.0 | 2.75μs | 1.33ns | 5.17ns | 0.0219 | 0 | 0 | 1.6 KB |
#6292 | EnrichedLog |
netcoreapp3.1 | 3.77μs | 1.44ns | 5.59ns | 0.0226 | 0 | 0 | 1.65 KB |
#6292 | EnrichedLog |
net472 | 4.33μs | 2.35ns | 9.09ns | 0.323 | 0 | 0 | 2.04 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 | 392ns | 0.494ns | 1.91ns | 0.00802 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 548ns | 0.609ns | 2.36ns | 0.00776 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 598ns | 1.66ns | 6.42ns | 0.0917 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 467ns | 0.605ns | 2.34ns | 0.00987 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 665ns | 1.21ns | 4.71ns | 0.00939 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 873ns | 2.22ns | 8.61ns | 0.104 | 0 | 0 | 658 B |
#6292 | StartFinishSpan |
net6.0 | 421ns | 0.476ns | 1.85ns | 0.00815 | 0 | 0 | 576 B |
#6292 | StartFinishSpan |
netcoreapp3.1 | 575ns | 0.478ns | 1.85ns | 0.00779 | 0 | 0 | 576 B |
#6292 | StartFinishSpan |
net472 | 585ns | 0.347ns | 1.3ns | 0.0916 | 0 | 0 | 578 B |
#6292 | StartFinishScope |
net6.0 | 497ns | 0.162ns | 0.606ns | 0.0097 | 0 | 0 | 696 B |
#6292 | StartFinishScope |
netcoreapp3.1 | 727ns | 0.462ns | 1.79ns | 0.00944 | 0 | 0 | 696 B |
#6292 | StartFinishScope |
net472 | 808ns | 1.26ns | 4.71ns | 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 | 722ns | 1.46ns | 5.66ns | 0.00987 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 932ns | 2.05ns | 7.96ns | 0.0089 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.06μs | 2.4ns | 9.29ns | 0.104 | 0 | 0 | 658 B |
#6292 | RunOnMethodBegin |
net6.0 | 664ns | 1.01ns | 3.93ns | 0.00962 | 0 | 0 | 696 B |
#6292 | RunOnMethodBegin |
netcoreapp3.1 | 925ns | 0.483ns | 1.87ns | 0.00919 | 0 | 0 | 696 B |
#6292 | RunOnMethodBegin |
net472 | 1.08μs | 1.3ns | 5.02ns | 0.104 | 0 | 0 | 658 B |
Datadog ReportBranch report: ❌ 651 Failed (2 Known Flaky), 208639 Passed, 2071 Skipped, 19h 58m 42.59s Total Time ❌ Failed Tests (651)
|
Summary of changes
This PR introduces caching functionality to optimize redaction decisions by implementing memoization using our Adaptive Cache system.
Reason for change
Redaction decision-making can be computationally expensive.