-
Notifications
You must be signed in to change notification settings - Fork 150
Stop using Tracer.Instance if we don't need to
#7744
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
base: andrew/settings/6-fix-telemetry-reporting
Are you sure you want to change the base?
Stop using Tracer.Instance if we don't need to
#7744
Conversation
| CommandType = typeof(TCommand); | ||
|
|
||
| if (TryGetIntegrationDetails(CommandType.FullName, out var integrationId, out var dbTypeName)) | ||
| if (TryGetIntegrationDetails(Tracer.Instance.Settings.DisabledAdoNetCommandTypes, CommandType.FullName, out var integrationId, out var dbTypeName)) |
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.
This one is actually kind of annoying. As it's in a static cctor, we can't pass it in anywhere, which means there's one DbScopeFactoryTests test which will use this and end up initializing the global tracer. Oh well.
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.
:sorry: pretty sure this was me
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.
Hmm. I understand that we want to minimize work but I feel like we should calculate all DbCommands regardless of config (i.e. no dependency here) and then we do the config check on the hot path, which allows this setting to be hot-reloadable or "config at runtime" ready
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.
Concretely, I'm suggesting that we remove the TryGetIntegrationDetails call in the static constructor of Cache<TCommand> and refactor the other call in CreateDbCommandScope a bit. Perhaps in a separate PR
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.
I can see arguments both ways tbh.
The only downside to @zacharycmontoya's proposal would be more work to do for custom DbCommands (ones that we don't explicitly know about), which are also marked as disabled initially, and which customers have marked as disabled. The question I would have is whether that's ok - e.g. if they're disabled because we're erroring out literally running TryGetIntegrationDetails, and that's why they disabled it, then that could be a problem. If it's just an optimization, then yes, it probably is fine.
That said, this actually is technically already hot-reloadable. The DisabledAdoNetCommandTypes setting passed in here is used to decide whether to populate the cache for custom types, but if we don't populate the cache, then we run TryGetIntegrationDetails() and check DisabledAdoNetCommandTypes at runtime anyway. So if this changes, then the result changes, it will just never be cached in that scenario.
So on that basis, I think removing the TryGetIntegrationDetails has a small amount of risk (if customer disabled adonet due to errors - not sure if that's really possible, but I can believe it), means a small bit more work (calculating values which will never be used), and doesn't change how hot-reloadable we are in general (though if we made it hot reloadable, we'd have to rethink how caching works). The plus side is it removes the static access to Tracer.Instance which is better for tests.
So yeah, I'm torn 🤷♂️ I'd say separate PR either way, given the questions, as the current behaviour in this PR is identical to the existing. But it's worth thinking about
This comment has been minimized.
This comment has been minimized.
| CommandType = typeof(TCommand); | ||
|
|
||
| if (TryGetIntegrationDetails(CommandType.FullName, out var integrationId, out var dbTypeName)) | ||
| if (TryGetIntegrationDetails(Tracer.Instance.Settings.DisabledAdoNetCommandTypes, CommandType.FullName, out var integrationId, out var dbTypeName)) |
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.
:sorry: pretty sure this was me
| [Fact] | ||
| public void CanRoundTripPathwayContext() | ||
| [Theory] | ||
| [CombinatorialData] |
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.
😃
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7744) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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 highlighted 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). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (75ms) : 68, 82
master - mean (76ms) : 71, 80
section Bailout
This PR (7744) - mean (79ms) : 72, 86
master - mean (79ms) : 75, 83
section CallTarget+Inlining+NGEN
This PR (7744) - mean (1,111ms) : 1049, 1173
master - mean (1,123ms) : 1040, 1206
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (119ms) : 109, 128
master - mean (117ms) : 110, 125
section Bailout
This PR (7744) - mean (118ms) : 112, 124
master - mean (119ms) : 110, 129
section CallTarget+Inlining+NGEN
This PR (7744) - mean (809ms) : 775, 844
master - mean (815ms) : 772, 857
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (104ms) : 97, 111
master - mean (105ms) : 99, 110
section Bailout
This PR (7744) - mean (105ms) : 99, 111
master - mean (106ms) : 99, 113
section CallTarget+Inlining+NGEN
This PR (7744) - mean (741ms) : 715, 767
master - mean (759ms) : 720, 799
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (101ms) : 93, 109
master - mean (107ms) : 97, 116
section Bailout
This PR (7744) - mean (104ms) : 95, 113
master - mean (104ms) : 97, 111
section CallTarget+Inlining+NGEN
This PR (7744) - mean (700ms) : 666, 734
master - mean (724ms) : 697, 751
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (193ms) : 189, 197
master - mean (192ms) : 189, 196
section Bailout
This PR (7744) - mean (197ms) : 192, 202
master - mean (196ms) : 193, 200
section CallTarget+Inlining+NGEN
This PR (7744) - mean (1,177ms) : 1124, 1230
master - mean (1,156ms) : 1110, 1202
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (281ms) : 271, 291
master - mean (276ms) : 271, 282
section Bailout
This PR (7744) - mean (284ms) : 267, 301
master - mean (276ms) : 272, 280
section CallTarget+Inlining+NGEN
This PR (7744) - mean (950ms) : 907, 994
master - mean (938ms) : 893, 983
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (269ms) : 264, 274
master - mean (268ms) : 262, 274
section Bailout
This PR (7744) - mean (276ms) : 263, 289
master - mean (289ms) : 282, 296
section CallTarget+Inlining+NGEN
This PR (7744) - mean (919ms) : 874, 965
master - mean (948ms) : 882, 1015
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7744) - mean (274ms) : 262, 285
master - mean (272ms) : 261, 282
section Bailout
This PR (7744) - mean (270ms) : 265, 274
master - mean (272ms) : 264, 280
section CallTarget+Inlining+NGEN
This PR (7744) - mean (857ms) : 831, 882
master - mean (865ms) : 827, 904
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8a3aee6 to
753da8d
Compare
1b1f494 to
f94e51b
Compare
753da8d to
3a96423
Compare
f94e51b to
75937f5
Compare
3a96423 to
f01f8c6
Compare
75937f5 to
8111379
Compare
f01f8c6 to
4fd8303
Compare
8111379 to
177c2a0
Compare
4fd8303 to
3ef006d
Compare
177c2a0 to
83efef1
Compare
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7744 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 ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 6.01 KB | 6.09 KB | 82 B | 1.36% |
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net6.0 | 5.49 KB | 5.53 KB | 38 B | 0.69% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.7μs | 59.6ns | 363ns | 0 | 0 | 0 | 5.49 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.6μs | 71.6ns | 365ns | 0 | 0 | 0 | 5.73 KB |
| master | StartStopWithChild |
net472 | 21.8μs | 117ns | 664ns | 0.865 | 0.324 | 0 | 6.01 KB |
| #7744 | StartStopWithChild |
net6.0 | 11.2μs | 59.7ns | 316ns | 0 | 0 | 0 | 5.53 KB |
| #7744 | StartStopWithChild |
netcoreapp3.1 | 13.9μs | 73.9ns | 370ns | 0 | 0 | 0 | 5.73 KB |
| #7744 | StartStopWithChild |
net472 | 22μs | 91.6ns | 420ns | 0.972 | 0.324 | 0.108 | 6.09 KB |
Benchmarks.Trace.AgentWriterBenchmark - Unknown 🤷 Fewer allocations 🎉
Fewer allocations 🎉 in #7744
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0
2.71 KB
0 b
-2.71 KB
-100.00%
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
2.7 KB
0 b
-2.7 KB
-100.00%
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
3.31 KB
0 b
-3.31 KB
-100.00%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 2.71 KB | 0 b | -2.71 KB | -100.00% |
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 2.7 KB | 0 b | -2.7 KB | -100.00% |
| Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 3.31 KB | 0 b | -3.31 KB | -100.00% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 928μs | 169ns | 656ns | 0 | 0 | 0 | 2.71 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.02ms | 137ns | 496ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.21ms | 784ns | 3.04μs | 0 | 0 | 0 | 3.31 KB |
| #7744 | WriteAndFlushEnrichedTraces |
net6.0 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| #7744 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
| #7744 | WriteAndFlushEnrichedTraces |
net472 | N/A | N/A | N/A | NaN | NaN | NaN | 0 b |
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 1.03μs | 6.1ns | 59.7ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.39μs | 7.51ns | 42.5ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.03μs | 0.42ns | 1.52ns | 0.193 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.15μs | 39.1ns | 225ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.16μs | 5.11ns | 19.8ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.56μs | 3ns | 11.6ns | 0.722 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 315ns | 1.71ns | 9.68ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 400ns | 2.26ns | 15.2ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 295ns | 0.0839ns | 0.325ns | 0.0441 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.28μs | 32.1ns | 161ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.71μs | 37.8ns | 151ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.71μs | 2.52ns | 9.75ns | 0.57 | 0 | 0 | 3.8 KB |
| #7744 | AllCycleSimpleBody |
net6.0 | 1.08μs | 5.66ns | 27.2ns | 0 | 0 | 0 | 1.22 KB |
| #7744 | AllCycleSimpleBody |
netcoreapp3.1 | 1.43μs | 7.52ns | 38.3ns | 0 | 0 | 0 | 1.2 KB |
| #7744 | AllCycleSimpleBody |
net472 | 1.01μs | 0.336ns | 1.26ns | 0.191 | 0 | 0 | 1.23 KB |
| #7744 | AllCycleMoreComplexBody |
net6.0 | 7.34μs | 4.7ns | 17.6ns | 0 | 0 | 0 | 4.72 KB |
| #7744 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.04μs | 46.1ns | 201ns | 0 | 0 | 0 | 4.62 KB |
| #7744 | AllCycleMoreComplexBody |
net472 | 7.63μs | 2.98ns | 11.6ns | 0.727 | 0 | 0 | 4.74 KB |
| #7744 | ObjectExtractorSimpleBody |
net6.0 | 329ns | 1.65ns | 7.55ns | 0 | 0 | 0 | 280 B |
| #7744 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 405ns | 0.212ns | 0.823ns | 0 | 0 | 0 | 272 B |
| #7744 | ObjectExtractorSimpleBody |
net472 | 308ns | 0.0818ns | 0.317ns | 0.0433 | 0 | 0 | 281 B |
| #7744 | ObjectExtractorMoreComplexBody |
net6.0 | 6.18μs | 33.3ns | 173ns | 0 | 0 | 0 | 3.79 KB |
| #7744 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.79μs | 28.6ns | 111ns | 0 | 0 | 0 | 3.69 KB |
| #7744 | ObjectExtractorMoreComplexBody |
net472 | 6.67μs | 3.05ns | 11.8ns | 0.602 | 0 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EncodeArgs |
net6.0 | 79.6μs | 369ns | 1.48μs | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 96.2μs | 238ns | 923ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 111μs | 73.7ns | 285ns | 5.02 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 142μs | 13.4ns | 50.2ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 200μs | 209ns | 754ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 262μs | 31.3ns | 113ns | 0 | 0 | 0 | 2.16 KB |
| #7744 | EncodeArgs |
net6.0 | 77.4μs | 116ns | 448ns | 0 | 0 | 0 | 32.4 KB |
| #7744 | EncodeArgs |
netcoreapp3.1 | 98.7μs | 276ns | 1.03μs | 0 | 0 | 0 | 32.4 KB |
| #7744 | EncodeArgs |
net472 | 111μs | 26.7ns | 103ns | 5 | 0 | 0 | 32.51 KB |
| #7744 | EncodeLegacyArgs |
net6.0 | 145μs | 17.7ns | 68.5ns | 0 | 0 | 0 | 2.15 KB |
| #7744 | EncodeLegacyArgs |
netcoreapp3.1 | 201μs | 437ns | 1.69μs | 0 | 0 | 0 | 2.14 KB |
| #7744 | EncodeLegacyArgs |
net472 | 266μs | 53.8ns | 208ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #7744
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1
2.011
423,895.04
852,613.51
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 | 2.011 | 423,895.04 | 852,613.51 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 396μs | 42.9ns | 155ns | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 424μs | 77ns | 298ns | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 427μs | 40.4ns | 146ns | 0 | 0 | 0 | 4.66 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 286μs | 51ns | 197ns | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 695μs | 12.9μs | 125μs | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 309μs | 25.1ns | 97.2ns | 0 | 0 | 0 | 2.29 KB |
| #7744 | RunWafRealisticBenchmark |
net6.0 | 392μs | 54.7ns | 212ns | 0 | 0 | 0 | 4.55 KB |
| #7744 | RunWafRealisticBenchmark |
netcoreapp3.1 | 811μs | 12.8μs | 127μs | 0 | 0 | 0 | 4.48 KB |
| #7744 | RunWafRealisticBenchmark |
net472 | 429μs | 55.5ns | 215ns | 0 | 0 | 0 | 4.66 KB |
| #7744 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 290μs | 77.3ns | 299ns | 0 | 0 | 0 | 2.24 KB |
| #7744 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 716μs | 3.44μs | 15μs | 0 | 0 | 0 | 2.22 KB |
| #7744 | RunWafRealisticBenchmarkWithAttack |
net472 | 312μs | 24.2ns | 93.6ns | 0 | 0 | 0 | 2.29 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 | 61.5μs | 59ns | 221ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 73.8μs | 400ns | 2.26μs | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00304ns | 0.00132ns | 0.00512ns | 0 | 0 | 0 | 0 b |
| #7744 | SendRequest |
net6.0 | 61.9μs | 282ns | 1.13μs | 0 | 0 | 0 | 14.52 KB |
| #7744 | SendRequest |
netcoreapp3.1 | 71.2μs | 338ns | 1.47μs | 0 | 0 | 0 | 17.42 KB |
| #7744 | SendRequest |
net472 | 0.00671ns | 0.00232ns | 0.00898ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7744
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
5 B
4 B
-1 B
-20.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
7 B
4 B
-3 B
-42.86%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 5 B | 4 B | -1 B | -20.00% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 7 B | 4 B | -3 B | -42.86% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.88ms | 2.96μs | 11.1μs | 0 | 0 | 0 | 640.01 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.12ms | 6.37μs | 23.8μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.7ms | 294ns | 1.1μs | 100 | 0 | 0 | 641.95 KB |
| master | OptimizedCharSlice |
net6.0 | 1.35ms | 160ns | 619ns | 0 | 0 | 0 | 7 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.73ms | 332ns | 1.29μs | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSlice |
net472 | 1.95ms | 200ns | 776ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 864μs | 39.6ns | 143ns | 0 | 0 | 0 | 5 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 835μs | 58.2ns | 225ns | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.15ms | 107ns | 401ns | 0 | 0 | 0 | 0 b |
| #7744 | OriginalCharSlice |
net6.0 | 1.93ms | 6.65μs | 24.9μs | 0 | 0 | 0 | 640.01 KB |
| #7744 | OriginalCharSlice |
netcoreapp3.1 | 2.3ms | 11μs | 42.7μs | 0 | 0 | 0 | 640 KB |
| #7744 | OriginalCharSlice |
net472 | 2.71ms | 492ns | 1.84μs | 100 | 0 | 0 | 641.95 KB |
| #7744 | OptimizedCharSlice |
net6.0 | 1.48ms | 196ns | 758ns | 0 | 0 | 0 | 4 B |
| #7744 | OptimizedCharSlice |
netcoreapp3.1 | 1.78ms | 244ns | 943ns | 0 | 0 | 0 | 1 B |
| #7744 | OptimizedCharSlice |
net472 | 1.99ms | 208ns | 805ns | 0 | 0 | 0 | 0 b |
| #7744 | OptimizedCharSliceWithPool |
net6.0 | 815μs | 37.2ns | 139ns | 0 | 0 | 0 | 4 B |
| #7744 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 814μs | 225ns | 873ns | 0 | 0 | 0 | 0 b |
| #7744 | OptimizedCharSliceWithPool |
net472 | 1.13ms | 128ns | 497ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ More allocations ⚠️
Slower ⚠️ in #7744
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
1.129
635,625.96
717,370.19
More allocations ⚠️ in #7744
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
56.01 KB
56.46 KB
443 B
0.79%
Fewer allocations 🎉 in #7744
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
41.98 KB
41.77 KB
-213 B
-0.51%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 1.129 | 635,625.96 | 717,370.19 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 56.01 KB | 56.46 KB | 443 B | 0.79% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 41.98 KB | 41.77 KB | -213 B | -0.51% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 639μs | 2.2μs | 8.23μs | 0 | 0 | 0 | 41.63 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 637μs | 760ns | 2.74μs | 0 | 0 | 0 | 41.98 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 904μs | 4.54μs | 20.3μs | 4.46 | 0 | 0 | 56.01 KB |
| #7744 | WriteAndFlushEnrichedTraces |
net6.0 | 698μs | 3.08μs | 13.4μs | 0 | 0 | 0 | 41.76 KB |
| #7744 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 718μs | 791ns | 3.06μs | 0 | 0 | 0 | 41.77 KB |
| #7744 | WriteAndFlushEnrichedTraces |
net472 | 871μs | 3.46μs | 13.4μs | 8.33 | 0 | 0 | 56.46 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.96μs | 1.84ns | 7.13ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.57μs | 10.8ns | 41.6ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.87μs | 3.64ns | 14.1ns | 0.143 | 0.0143 | 0 | 987 B |
| #7744 | ExecuteNonQuery |
net6.0 | 1.96μs | 7.61ns | 29.5ns | 0 | 0 | 0 | 1.02 KB |
| #7744 | ExecuteNonQuery |
netcoreapp3.1 | 2.58μs | 9.4ns | 36.4ns | 0 | 0 | 0 | 1.02 KB |
| #7744 | ExecuteNonQuery |
net472 | 2.84μs | 3.8ns | 14.7ns | 0.156 | 0.0142 | 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.69μs | 0.722ns | 2.8ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.23μs | 4.61ns | 17.9ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.53μs | 5.63ns | 21.8ns | 0.158 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.91μs | 9.52ns | 42.6ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.33μs | 11ns | 42.8ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.63μs | 2.38ns | 9.21ns | 0.162 | 0 | 0 | 1.1 KB |
| #7744 | CallElasticsearch |
net6.0 | 1.79μs | 2.62ns | 10.1ns | 0 | 0 | 0 | 1.03 KB |
| #7744 | CallElasticsearch |
netcoreapp3.1 | 2.24μs | 10.5ns | 42ns | 0 | 0 | 0 | 1.03 KB |
| #7744 | CallElasticsearch |
net472 | 3.67μs | 3.84ns | 14.9ns | 0.165 | 0 | 0 | 1.04 KB |
| #7744 | CallElasticsearchAsync |
net6.0 | 1.82μs | 1.84ns | 6.63ns | 0 | 0 | 0 | 1.01 KB |
| #7744 | CallElasticsearchAsync |
netcoreapp3.1 | 2.38μs | 11.4ns | 44.3ns | 0 | 0 | 0 | 1.08 KB |
| #7744 | CallElasticsearchAsync |
net472 | 3.9μs | 2.57ns | 9.95ns | 0.156 | 0 | 0 | 1.1 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.83μs | 2.73ns | 10.6ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.51μs | 12ns | 46.4ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.67μs | 5.01ns | 19.4ns | 0.135 | 0 | 0 | 915 B |
| #7744 | ExecuteAsync |
net6.0 | 1.95μs | 9.67ns | 43.3ns | 0 | 0 | 0 | 952 B |
| #7744 | ExecuteAsync |
netcoreapp3.1 | 2.46μs | 11.7ns | 45.5ns | 0 | 0 | 0 | 952 B |
| #7744 | ExecuteAsync |
net472 | 2.61μs | 1.27ns | 4.74ns | 0.144 | 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 | 6.93μs | 25.7ns | 96.1ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.52μs | 20ns | 77.4ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 12.3μs | 11ns | 42.5ns | 0.491 | 0 | 0 | 3.18 KB |
| #7744 | SendAsync |
net6.0 | 6.78μs | 2.65ns | 9.57ns | 0 | 0 | 0 | 2.36 KB |
| #7744 | SendAsync |
netcoreapp3.1 | 8.47μs | 22.5ns | 84ns | 0 | 0 | 0 | 2.9 KB |
| #7744 | SendAsync |
net472 | 12.2μs | 9.46ns | 36.7ns | 0.487 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7744
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
250.18 KB
255.89 KB
5.71 KB
2.28%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472
278.53 KB
282.18 KB
3.65 KB
1.31%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1
42.64 KB
43.12 KB
480 B
1.13%
Fewer allocations 🎉 in #7744
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0
44.06 KB
43.82 KB
-248 B
-0.56%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
266.99 KB
258.29 KB
-8.7 KB
-3.26%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 250.18 KB | 255.89 KB | 5.71 KB | 2.28% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 278.53 KB | 282.18 KB | 3.65 KB | 1.31% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 | 42.64 KB | 43.12 KB | 480 B | 1.13% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 | 44.06 KB | 43.82 KB | -248 B | -0.56% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 266.99 KB | 258.29 KB | -8.7 KB | -3.26% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45μs | 251ns | 2.04μs | 0 | 0 | 0 | 44.06 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 46.9μs | 221ns | 1.08μs | 0 | 0 | 0 | 42.64 KB |
| master | StringConcatBenchmark |
net472 | 57.6μs | 75.3ns | 261ns | 0 | 0 | 0 | 57.34 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 458μs | 1.78μs | 7.78μs | 0 | 0 | 0 | 266.99 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 512μs | 552ns | 1.99μs | 0 | 0 | 0 | 250.18 KB |
| master | StringConcatAspectBenchmark |
net472 | 408μs | 2.32μs | 16.7μs | 0 | 0 | 0 | 278.53 KB |
| #7744 | StringConcatBenchmark |
net6.0 | 49.3μs | 263ns | 1.8μs | 0 | 0 | 0 | 43.82 KB |
| #7744 | StringConcatBenchmark |
netcoreapp3.1 | 54.1μs | 644ns | 6.41μs | 0 | 0 | 0 | 43.12 KB |
| #7744 | StringConcatBenchmark |
net472 | 57.2μs | 267ns | 1.19μs | 0 | 0 | 0 | 57.34 KB |
| #7744 | StringConcatAspectBenchmark |
net6.0 | 452μs | 2.09μs | 7.81μs | 0 | 0 | 0 | 258.29 KB |
| #7744 | StringConcatAspectBenchmark |
netcoreapp3.1 | 492μs | 2.03μs | 7.59μs | 0 | 0 | 0 | 255.89 KB |
| #7744 | StringConcatAspectBenchmark |
net472 | 411μs | 2.38μs | 18.7μs | 0 | 0 | 0 | 282.18 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 | 2.64μs | 13.8ns | 68.8ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.69μs | 16.2ns | 62.8ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.82μs | 4.01ns | 15.5ns | 0.247 | 0 | 0 | 1.64 KB |
| #7744 | EnrichedLog |
net6.0 | 2.87μs | 15.1ns | 79.8ns | 0 | 0 | 0 | 1.71 KB |
| #7744 | EnrichedLog |
netcoreapp3.1 | 3.65μs | 8.84ns | 33.1ns | 0 | 0 | 0 | 1.7 KB |
| #7744 | EnrichedLog |
net472 | 3.9μs | 3ns | 11.6ns | 0.254 | 0 | 0 | 1.64 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 | 135μs | 326ns | 1.26μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 135μs | 502ns | 1.94μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 177μs | 611ns | 2.37μs | 0 | 0 | 0 | 4.52 KB |
| #7744 | EnrichedLog |
net6.0 | 123μs | 103ns | 387ns | 0 | 0 | 0 | 4.31 KB |
| #7744 | EnrichedLog |
netcoreapp3.1 | 127μs | 109ns | 393ns | 0 | 0 | 0 | 4.31 KB |
| #7744 | EnrichedLog |
net472 | 166μs | 90.1ns | 349ns | 0 | 0 | 0 | 4.51 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 | 4.96μs | 20.5ns | 79.2ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.68μs | 21.6ns | 83.8ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.48μs | 5.54ns | 21.5ns | 0.298 | 0 | 0 | 2.08 KB |
| #7744 | EnrichedLog |
net6.0 | 5.01μs | 19.1ns | 71.6ns | 0 | 0 | 0 | 2.26 KB |
| #7744 | EnrichedLog |
netcoreapp3.1 | 6.8μs | 14.8ns | 57.5ns | 0 | 0 | 0 | 2.26 KB |
| #7744 | EnrichedLog |
net472 | 7.58μs | 15.1ns | 58.3ns | 0.299 | 0 | 0 | 2.08 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 | 2.08μs | 4ns | 15.5ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.66μs | 13.8ns | 66.1ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.03μs | 0.991ns | 3.71ns | 0.182 | 0 | 0 | 1.2 KB |
| #7744 | SendReceive |
net6.0 | 2.01μs | 10.5ns | 50.3ns | 0 | 0 | 0 | 1.2 KB |
| #7744 | SendReceive |
netcoreapp3.1 | 2.57μs | 12.7ns | 56.7ns | 0 | 0 | 0 | 1.2 KB |
| #7744 | SendReceive |
net472 | 3.13μs | 1.83ns | 6.85ns | 0.19 | 0 | 0 | 1.2 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 | 4.28μs | 4.24ns | 15.9ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.69μs | 13.2ns | 51ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.65μs | 7.12ns | 26.6ns | 0.299 | 0 | 0 | 2.03 KB |
| #7744 | EnrichedLog |
net6.0 | 4.39μs | 1.96ns | 7.58ns | 0 | 0 | 0 | 1.58 KB |
| #7744 | EnrichedLog |
netcoreapp3.1 | 5.6μs | 7.04ns | 26.3ns | 0 | 0 | 0 | 1.63 KB |
| #7744 | EnrichedLog |
net472 | 6.75μs | 7.76ns | 30.1ns | 0.303 | 0 | 0 | 2.03 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 | 775ns | 0.272ns | 1.06ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 957ns | 4.88ns | 23.4ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 945ns | 0.211ns | 0.762ns | 0.0899 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 925ns | 3.18ns | 12.3ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.21μs | 6.14ns | 27.5ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.14μs | 0.352ns | 1.36ns | 0.103 | 0 | 0 | 658 B |
| #7744 | StartFinishSpan |
net6.0 | 785ns | 0.338ns | 1.31ns | 0 | 0 | 0 | 576 B |
| #7744 | StartFinishSpan |
netcoreapp3.1 | 967ns | 5.1ns | 26ns | 0 | 0 | 0 | 576 B |
| #7744 | StartFinishSpan |
net472 | 934ns | 2.42ns | 9.35ns | 0.0891 | 0 | 0 | 578 B |
| #7744 | StartFinishScope |
net6.0 | 929ns | 4.6ns | 19ns | 0 | 0 | 0 | 696 B |
| #7744 | StartFinishScope |
netcoreapp3.1 | 1.19μs | 6.2ns | 31ns | 0 | 0 | 0 | 697 B |
| #7744 | StartFinishScope |
net472 | 1.1μs | 0.498ns | 1.93ns | 0.0994 | 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 | 1.05μs | 5.6ns | 27.4ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.47μs | 5.94ns | 23ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.47μs | 1.29ns | 5ns | 0.102 | 0 | 0 | 658 B |
| #7744 | RunOnMethodBegin |
net6.0 | 1.09μs | 5.1ns | 20.4ns | 0 | 0 | 0 | 696 B |
| #7744 | RunOnMethodBegin |
netcoreapp3.1 | 1.45μs | 7.63ns | 37.4ns | 0 | 0 | 0 | 696 B |
| #7744 | RunOnMethodBegin |
net472 | 1.45μs | 1.78ns | 6.67ns | 0.101 | 0 | 0 | 658 B |
3ef006d to
e5c8a18
Compare
83efef1 to
40cc2d6
Compare
e5c8a18 to
75e54ce
Compare
40cc2d6 to
d08d676
Compare
75e54ce to
6027e13
Compare
d08d676 to
85a6731
Compare
6027e13 to
bab50b1
Compare
85a6731 to
5ee2a7f
Compare
bab50b1 to
ff45b9a
Compare
5ee2a7f to
53d59b0
Compare
ff45b9a to
b2fc233
Compare
53d59b0 to
95e3713
Compare
b2fc233 to
51ec16a
Compare
95e3713 to
3238b3e
Compare
51ec16a to
fade217
Compare
3238b3e to
11c23d3
Compare
fade217 to
1c51ccb
Compare
1c51ccb to
10ce7a6
Compare
Summary of changes
Updates a couple of places where we're calling
Tracer.Instancewhere we don't need toReason for change
In one of my other PRs I accidentally broke something that should only have affected integration tests, but a bunch of unit tests broke. It highlighted where they were using
Tracer.Instanceand setting the global tracer for tests. In other places, it revealed that code that tests that looked independent of other tests really wasn't...Calling
Tracer.Instancepotentially does a lot of work, as it initializes the tracer. It's also hard to follow if we're making static calls out in places we don't need to. So just pass through the settings we want instead.Implementation details
Instead of calling
Tracer.Instance.Settings, use the value ofTracerorTracerSettingsthat's already available wherever possible. It makes the tests cleaner too.Test coverage
Same coverage, just a bit cleaner
Other details
Included as part of the config stack, just because I already refactored some of this code, and can't be bothered to faff with merge conflicts:
https://datadoghq.atlassian.net/browse/LANGPLAT-819
MutableSettingsfromTracerSettings#7522MutableSettingson dynamic config changes #7525DefaultServiceNametoMutableSettings#7530PerTraceSettings.GetServiceName()#7532TracerSettingsto useMutableSettingswhere appropriate #7543IsIntegrationEnabled(),IsErrorStatusCode(), andGetIntegrationAnalyticsSampleRate()#7544DictionaryExtensions.SequenceEqual#7722SettingsManagerfor managing mutable settings and ExporterSettings #7695TracerSettingswhich can change at runtime #7723MutableSettingsandExporterSettingswithout rebuilding #7724Tracer.Instanceif we don't need to #7744 👈