-
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
[TRACER] Ensure synchronization in MethodInfo lazy operations #5698
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 341231 Passed, 2156 Skipped, 22h 51m 17.52s Total Time |
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 (5698) - mean (73ms) : 65, 82
. : milestone, 73,
master - mean (73ms) : 64, 82
. : milestone, 73,
section CallTarget+Inlining+NGEN
This PR (5698) - mean (1,005ms) : 982, 1029
. : milestone, 1005,
master - mean (1,004ms) : 984, 1025
. : milestone, 1004,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5698) - mean (109ms) : 106, 111
. : milestone, 109,
master - mean (110ms) : 106, 114
. : milestone, 110,
section CallTarget+Inlining+NGEN
This PR (5698) - mean (717ms) : 690, 744
. : milestone, 717,
master - mean (719ms) : 695, 743
. : milestone, 719,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5698) - mean (93ms) : 88, 97
. : milestone, 93,
master - mean (93ms) : 90, 97
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (5698) - mean (669ms) : 650, 687
. : milestone, 669,
master - mean (672ms) : 650, 695
. : milestone, 672,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5698) - mean (191ms) : 187, 195
. : milestone, 191,
master - mean (191ms) : 187, 196
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (5698) - mean (1,106ms) : 1079, 1133
. : milestone, 1106,
master - mean (1,103ms) : 1079, 1128
. : milestone, 1103,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5698) - mean (281ms) : 273, 290
. : milestone, 281,
master - mean (277ms) : 272, 281
. : milestone, 277,
section CallTarget+Inlining+NGEN
This PR (5698) - mean (906ms) : 883, 929
. : milestone, 906,
master - mean (900ms) : 873, 927
. : milestone, 900,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5698) - mean (268ms) : 262, 273
. : milestone, 268,
master - mean (264ms) : 261, 267
. : milestone, 264,
section CallTarget+Inlining+NGEN
This PR (5698) - mean (885ms) : 861, 908
. : milestone, 885,
master - mean (882ms) : 856, 909
. : milestone, 882,
|
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 (5698) (11.408M) : 0, 11407721
master (11.448M) : 0, 11447847
benchmarks/2.9.0 (11.549M) : 0, 11548501
section Automatic
This PR (5698) (7.578M) : 0, 7578038
master (7.788M) : 0, 7788488
benchmarks/2.9.0 (8.048M) : 0, 8047587
section Trace stats
master (8.027M) : 0, 8027001
section Manual
This PR (5698) (9.737M) : 0, 9736657
master (9.943M) : 0, 9943278
section Manual + Automatic
This PR (5698) (7.228M) : 0, 7228184
master (7.271M) : 0, 7271151
section Version Conflict
master (6.585M) : 0, 6585167
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (5698) (9.482M) : 0, 9482346
master (9.458M) : 0, 9457647
benchmarks/2.9.0 (9.577M) : 0, 9576808
section Automatic
This PR (5698) (6.601M) : 0, 6601471
master (6.583M) : 0, 6582951
section Trace stats
master (6.847M) : 0, 6847454
section Manual
This PR (5698) (8.384M) : 0, 8383973
master (8.112M) : 0, 8112217
section Manual + Automatic
This PR (5698) (6.243M) : 0, 6243323
master (6.131M) : 0, 6130797
section Version Conflict
master (5.653M) : 0, 5652860
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (5698) (10.246M) : 0, 10246157
master (10.155M) : 0, 10155212
benchmarks/2.9.0 (10.137M) : 0, 10136673
section Automatic
This PR (5698) (7.345M) : 0, 7345456
master (7.235M) : 0, 7235269
benchmarks/2.9.0 (7.555M) : 0, 7555427
section Trace stats
master (7.562M) : 0, 7562154
section Manual
This PR (5698) (9.065M) : 0, 9065041
master (8.975M) : 0, 8974692
section Manual + Automatic
This PR (5698) (6.969M) : 0, 6968724
master (7.042M) : 0, 7041944
section Version Conflict
master (6.204M) : 0, 6204131
|
Benchmarks Report for tracer 🐌Benchmarks for #5698 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 - 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 - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 | 1.173 | 1,246.94 | 1,462.91 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendReceive |
net6.0 | 1.25μs | 0.514ns | 1.92ns | 0.0162 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.78μs | 0.594ns | 2.22ns | 0.0152 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.04μs | 1.48ns | 5.53ns | 0.183 | 0 | 0 | 1.16 KB |
#5698 | SendReceive |
net6.0 | 1.46μs | 0.933ns | 3.62ns | 0.0161 | 0 | 0 | 1.14 KB |
#5698 | SendReceive |
netcoreapp3.1 | 1.73μs | 0.999ns | 3.87ns | 0.0149 | 0 | 0 | 1.14 KB |
#5698 | SendReceive |
net472 | 2.09μs | 0.972ns | 3.64ns | 0.183 | 0.00104 | 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.87μs | 1.26ns | 4.88ns | 0.0216 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.88μs | 1.26ns | 4.56ns | 0.0213 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.51μs | 1.29ns | 5.01ns | 0.322 | 0 | 0 | 2.04 KB |
#5698 | EnrichedLog |
net6.0 | 2.78μs | 1.13ns | 4.39ns | 0.0222 | 0 | 0 | 1.6 KB |
#5698 | EnrichedLog |
netcoreapp3.1 | 3.89μs | 1.55ns | 6ns | 0.0214 | 0 | 0 | 1.65 KB |
#5698 | EnrichedLog |
net472 | 4.32μs | 1.34ns | 5.01ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #5698
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0
1.149
558.68
486.33
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.149 | 558.68 | 486.33 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 400ns | 0.188ns | 0.703ns | 0.00819 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 618ns | 0.576ns | 2.16ns | 0.00776 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 671ns | 0.865ns | 3.35ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 559ns | 0.245ns | 0.949ns | 0.00982 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 721ns | 0.454ns | 1.76ns | 0.00937 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 845ns | 0.308ns | 1.19ns | 0.104 | 0 | 0 | 658 B |
#5698 | StartFinishSpan |
net6.0 | 395ns | 0.133ns | 0.513ns | 0.00813 | 0 | 0 | 576 B |
#5698 | StartFinishSpan |
netcoreapp3.1 | 591ns | 0.342ns | 1.28ns | 0.00776 | 0 | 0 | 576 B |
#5698 | StartFinishSpan |
net472 | 718ns | 0.445ns | 1.72ns | 0.0915 | 0 | 0 | 578 B |
#5698 | StartFinishScope |
net6.0 | 486ns | 0.164ns | 0.635ns | 0.00985 | 0 | 0 | 696 B |
#5698 | StartFinishScope |
netcoreapp3.1 | 746ns | 0.447ns | 1.73ns | 0.00939 | 0 | 0 | 696 B |
#5698 | StartFinishScope |
net472 | 871ns | 0.833ns | 3.22ns | 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 | 636ns | 0.405ns | 1.4ns | 0.00953 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 911ns | 0.409ns | 1.53ns | 0.00955 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.1μs | 1.49ns | 5.79ns | 0.104 | 0 | 0 | 658 B |
#5698 | RunOnMethodBegin |
net6.0 | 607ns | 0.469ns | 1.82ns | 0.00978 | 0 | 0 | 696 B |
#5698 | RunOnMethodBegin |
netcoreapp3.1 | 884ns | 0.372ns | 1.39ns | 0.00936 | 0 | 0 | 696 B |
#5698 | RunOnMethodBegin |
net472 | 1.08μs | 0.564ns | 2.18ns | 0.104 | 0 | 0 | 658 B |
Benchmarks Report for appsec 🐌Benchmarks for #5698 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 59.04 KB | 61.6 KB | 2.56 KB | 4.34% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 52.5μs | 240ns | 928ns | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 61.3μs | 712ns | 7.12μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 38.4μs | 173ns | 624ns | 0 | 0 | 0 | 59.04 KB |
master | StringConcatAspectBenchmark |
net6.0 | 312μs | 1.69μs | 9.88μs | 0 | 0 | 0 | 255.05 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 335μs | 1.87μs | 12.4μs | 0 | 0 | 0 | 253.78 KB |
master | StringConcatAspectBenchmark |
net472 | 303μs | 7.12μs | 68.7μs | 0 | 0 | 0 | 278.53 KB |
#5698 | StringConcatBenchmark |
net6.0 | 59.2μs | 701ns | 6.86μs | 0 | 0 | 0 | 43.44 KB |
#5698 | StringConcatBenchmark |
netcoreapp3.1 | 62μs | 801ns | 7.89μs | 0 | 0 | 0 | 42.64 KB |
#5698 | StringConcatBenchmark |
net472 | 38.2μs | 101ns | 377ns | 0 | 0 | 0 | 61.6 KB |
#5698 | StringConcatAspectBenchmark |
net6.0 | 309μs | 1.69μs | 13.1μs | 0 | 0 | 0 | 254.74 KB |
#5698 | StringConcatAspectBenchmark |
netcoreapp3.1 | 339μs | 1.58μs | 13.4μs | 0 | 0 | 0 | 253.58 KB |
#5698 | StringConcatAspectBenchmark |
net472 | 295μs | 4.98μs | 48.3μs | 0 | 0 | 0 | 278.53 KB |
… GetFullname) Made MethodInfoi::IsExcluded not lazy Fix params string formation
288aef4
to
0c4c536
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 comment :)
WSTRING GetMemberName(); | ||
WSTRING GetFullName(); | ||
WSTRING& GetName(); | ||
WSTRING& GetFullName(); | ||
WSTRING GetFullNameWithReturnType(); |
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.
Why does all other functions returning WSTRING
changed to WSTRING&
but not the GetFullNameWithReturnType()
one?
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.
Because it's calculated and not returning a field
Summary of changes
Aded better synchronization in
MethodInfo
lazy initializationReason for change
Some crashes in
GetFullName()
andIsExcluded()
have been reportedImplementation details
IsExcluded()
init moved toctor
.GetFullName()
synched with parent's module mutex.