Skip to content

Minor updates for libdatadog data pipeline changes #7115

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

Merged
merged 4 commits into from
Jun 20, 2025

Conversation

andrewlock
Copy link
Member

Summary of changes

  • Simplify the copying of libdatadog for tests
  • Minor changes to the serilog logger to allow subsequent usage by libdatadog

Reason for change

Prerequistes for #7075

Implementation details

  • Copy the libdatadog file to all the test output directories (maintaining a seperate list of projects to copy is redundant, and ever-increasing.
  • Expose FileLoggingConfiguration on DatadogSerilogLogger (we already exposed one of the properties, may as well expose it all

Test coverage

If it builds, we're good

Other details

Required for

@andrewlock andrewlock added area:builds project files, build scripts, pipelines, versioning, releases, packages type:refactor labels Jun 17, 2025
@andrewlock andrewlock requested review from a team as code owners June 17, 2025 09:51
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jun 17, 2025

Datadog Report

All test runs 758cad7 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 0 0 0 244990 2462 15h 41m 45.11s Link
exploration_tests 0 0 0 22085 3 2m 15.95s Link

@andrewlock andrewlock force-pushed the andrew/minor-libddog-updates branch from e173e99 to 9ff3268 Compare June 17, 2025 11:04
var dest = testBinFolder / framework / $"LibDatadog.dylib";
CopyFile(source, dest, FileExistsPolicy.Overwrite);
}
var dest = testBinFolder / framework / $"LibDatadog.{ext}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach but I have a question.

As we are looping through frameworks twice (once frameworks.Where(x=> x == Framework) and another time with this foreach) and we aren't using it between L673 and L684,
Wouldn't it be simpler to move the where predicate condition (x == Framework that is) and inverse it:

Suggested change
var dest = testBinFolder / framework / $"LibDatadog.{ext}";
if (framework != Framework)
{
continue;
}
var dest = testBinFolder / framework / $"LibDatadog.{ext}";

now maybe there is something I'm missing 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we could, but we would also need to add the Framework is not null case in there, so I think it's prob simpler as is tbh.

Copy link
Contributor

@bricefriha bricefriha Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true I missed that sorry.
Well in this case maybe we could simply do that 😁:

Suggested change
var dest = testBinFolder / framework / $"LibDatadog.{ext}";
if (Framework is not null && framework != Framework)
{
continue;
}
var dest = testBinFolder / framework / $"LibDatadog.{ext}";

therefore if Framework is null, we use the element as is. otherwise we compare it with Framework's value and skip if they are different.

I don't think it's more complicated.

I know I don't always suggest the prettiest code 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other thing is that the current code reads as something such as "get the frameworks that we care about, then process them" whereas the more optimized one reads as "process all of the frameworks, then determine whether we care about the framework"

It's really just a readability thing IMO, it may be more performant but I don't think that matters too much for this code in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do see your point, here.
I personally read the latter as "Go through all the frameworks and only process the one we care about".
But if you all find it more difficult to read, go for the former as It's for the build so I think readability is more important still

@pr-commenter
Copy link

pr-commenter bot commented Jun 17, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7115 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.222
  • 43 benchmarks have fewer allocations
  • 4 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.75 KB 5.72 KB -36 B -0.63%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.09 KB 6 KB -90 B -1.48%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net6.0 5.58 KB 5.49 KB -91 B -1.63%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 11.2μs 59.7ns 322ns 0 0 0 5.58 KB
master StartStopWithChild netcoreapp3.1 14.1μs 67.5ns 286ns 0 0 0 5.75 KB
master StartStopWithChild net472 22.1μs 119ns 651ns 1.03 0.411 0.103 6.09 KB
#7115 StartStopWithChild net6.0 10.5μs 57.7ns 341ns 0 0 0 5.49 KB
#7115 StartStopWithChild netcoreapp3.1 13.6μs 68.9ns 323ns 0 0 0 5.72 KB
#7115 StartStopWithChild net472 22.2μs 96.2ns 373ns 1.04 0.415 0.104 6 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.33 KB 3.31 KB -23 B -0.69%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 927μs 26.6ns 103ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 404ns 1.56μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.25ms 357ns 1.38μs 0 0 0 3.33 KB
#7115 WriteAndFlushEnrichedTraces net6.0 923μs 216ns 837ns 0 0 0 2.7 KB
#7115 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 906ns 3.51μs 0 0 0 2.7 KB
#7115 WriteAndFlushEnrichedTraces net472 1.2ms 93.5ns 362ns 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 236.35 KB 239.64 KB 3.29 KB 1.39%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 239.87 KB 243.15 KB 3.28 KB 1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 331μs 1.76μs 8.42μs 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 510μs 1.45μs 5.61μs 0 0 0 204.77 KB
master AllCycleSimpleBody net472 436μs 119ns 460ns 36.6 2.16 0 236.35 KB
master AllCycleMoreComplexBody net6.0 338μs 1.76μs 8.8μs 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 495μs 987ns 3.56μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 446μs 106ns 412ns 36.6 2.16 0 239.87 KB
master ObjectExtractorSimpleBody net6.0 311ns 1.77ns 12.3ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 409ns 1.93ns 8.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 303ns 0.175ns 0.676ns 0.0442 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.52μs 29.5ns 110ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.76μs 36.2ns 140ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.66μs 0.89ns 3.33ns 0.599 0 0 3.8 KB
#7115 AllCycleSimpleBody net6.0 326μs 1.62μs 7.08μs 0 0 0 197.59 KB
#7115 AllCycleSimpleBody netcoreapp3.1 473μs 1.74μs 6.73μs 0 0 0 205.35 KB
#7115 AllCycleSimpleBody net472 444μs 178ns 690ns 37.9 2.23 0 239.64 KB
#7115 AllCycleMoreComplexBody net6.0 336μs 1.49μs 5.76μs 0 0 0 201.1 KB
#7115 AllCycleMoreComplexBody netcoreapp3.1 483μs 2.22μs 8.6μs 0 0 0 208.77 KB
#7115 AllCycleMoreComplexBody net472 454μs 281ns 1.09μs 37.9 2.23 0 243.15 KB
#7115 ObjectExtractorSimpleBody net6.0 323ns 1.66ns 7.42ns 0 0 0 280 B
#7115 ObjectExtractorSimpleBody netcoreapp3.1 402ns 1.97ns 8.14ns 0 0 0 272 B
#7115 ObjectExtractorSimpleBody net472 309ns 0.0717ns 0.278ns 0.0438 0 0 281 B
#7115 ObjectExtractorMoreComplexBody net6.0 6.39μs 24.2ns 90.4ns 0 0 0 3.78 KB
#7115 ObjectExtractorMoreComplexBody netcoreapp3.1 7.76μs 5.53ns 21.4ns 0 0 0 3.69 KB
#7115 ObjectExtractorMoreComplexBody net472 6.83μs 2.4ns 8.64ns 0.579 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs‑net6.0 2.16 KB 2.15 KB -11 B -0.51%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 73.3μs 263ns 984ns 0 0 0 32.41 KB
master EncodeArgs netcoreapp3.1 95.7μs 36.2ns 130ns 0 0 0 32.4 KB
master EncodeArgs net472 107μs 17.6ns 65.8ns 4.82 0 0 32.51 KB
master EncodeLegacyArgs net6.0 143μs 122ns 472ns 0 0 0 2.16 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 42.5ns 147ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 66.8ns 250ns 0 0 0 2.16 KB
#7115 EncodeArgs net6.0 73μs 33.7ns 126ns 0 0 0 32.4 KB
#7115 EncodeArgs netcoreapp3.1 95.1μs 158ns 612ns 0 0 0 32.4 KB
#7115 EncodeArgs net472 104μs 12.8ns 49.6ns 4.69 0 0 32.5 KB
#7115 EncodeLegacyArgs net6.0 145μs 13.9ns 52ns 0 0 0 2.15 KB
#7115 EncodeLegacyArgs netcoreapp3.1 198μs 108ns 404ns 0 0 0 2.14 KB
#7115 EncodeLegacyArgs net472 263μs 77ns 288ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 271μs 133ns 499ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 294μs 264ns 989ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 307μs 38.1ns 147ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 181μs 80.1ns 300ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 198μs 104ns 404ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 207μs 45.3ns 169ns 0 0 0 2.28 KB
#7115 RunWafRealisticBenchmark net6.0 270μs 85.2ns 319ns 0 0 0 4.55 KB
#7115 RunWafRealisticBenchmark netcoreapp3.1 299μs 86.5ns 324ns 0 0 0 4.48 KB
#7115 RunWafRealisticBenchmark net472 308μs 54.7ns 212ns 0 0 0 4.66 KB
#7115 RunWafRealisticBenchmarkWithAttack net6.0 182μs 36.6ns 142ns 0 0 0 2.24 KB
#7115 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 199μs 251ns 939ns 0 0 0 2.22 KB
#7115 RunWafRealisticBenchmarkWithAttack net472 207μs 33ns 128ns 0 0 0 2.28 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.1μs 29ns 104ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 69.9μs 118ns 440ns 0 0 0 17.42 KB
master SendRequest net472 0.0171ns 0.00147ns 0.00551ns 0 0 0 0 b
#7115 SendRequest net6.0 60.7μs 125ns 484ns 0 0 0 14.52 KB
#7115 SendRequest netcoreapp3.1 71.2μs 82.3ns 297ns 0 0 0 17.43 KB
#7115 SendRequest net472 0.0177ns 0.00107ns 0.00416ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.75 KB 56.49 KB 738 B 1.32%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 645μs 512ns 1.98μs 0 0 0 41.73 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 631μs 1.67μs 6.67μs 0 0 0 41.89 KB
master WriteAndFlushEnrichedTraces net472 923μs 1.93μs 7.2μs 4.46 0 0 55.75 KB
#7115 WriteAndFlushEnrichedTraces net6.0 628μs 421ns 1.57μs 0 0 0 41.64 KB
#7115 WriteAndFlushEnrichedTraces netcoreapp3.1 644μs 1.01μs 3.64μs 0 0 0 42.06 KB
#7115 WriteAndFlushEnrichedTraces net472 881μs 4.57μs 33.6μs 8.33 0 0 56.49 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.03 KB 1.02 KB -8 B -0.78%
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑netcoreapp3.1 1.02 KB 1.02 KB -8 B -0.78%
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net472 995 B 987 B -8 B -0.80%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.99μs 10.2ns 46.8ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.53μs 3.43ns 13.3ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.7μs 2.41ns 9.34ns 0.147 0.0134 0 995 B
#7115 ExecuteNonQuery net6.0 2μs 6.05ns 23.4ns 0 0 0 1.02 KB
#7115 ExecuteNonQuery netcoreapp3.1 2.54μs 6.52ns 24.4ns 0 0 0 1.02 KB
#7115 ExecuteNonQuery net472 2.76μs 5.77ns 22.4ns 0.152 0.0139 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472 1.11 KB 1.1 KB -8 B -0.72%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 1.09 KB 1.08 KB -8 B -0.74%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net472 1.05 KB 1.04 KB -8 B -0.76%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.04 KB 1.03 KB -8 B -0.77%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑netcoreapp3.1 1.04 KB 1.03 KB -8 B -0.77%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 1.02 KB 1.01 KB -8 B -0.79%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.83μs 5.85ns 22.7ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.3μs 11.8ns 56.6ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.55μs 3.05ns 11.8ns 0.159 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.81μs 3.89ns 14.5ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.35μs 7.26ns 28.1ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.84μs 3.19ns 12.4ns 0.169 0 0 1.11 KB
#7115 CallElasticsearch net6.0 1.79μs 0.892ns 3.46ns 0 0 0 1.03 KB
#7115 CallElasticsearch netcoreapp3.1 2.32μs 11.3ns 45.3ns 0 0 0 1.03 KB
#7115 CallElasticsearch net472 3.56μs 2ns 7.21ns 0.161 0 0 1.04 KB
#7115 CallElasticsearchAsync net6.0 1.87μs 2.65ns 10.3ns 0 0 0 1.01 KB
#7115 CallElasticsearchAsync netcoreapp3.1 2.35μs 11.3ns 43.6ns 0 0 0 1.08 KB
#7115 CallElasticsearchAsync net472 3.69μs 2.26ns 8.77ns 0.168 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 960 B 952 B -8 B -0.83%
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 960 B 952 B -8 B -0.83%
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net472 923 B 915 B -8 B -0.87%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.78μs 9.27ns 43.5ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.29μs 7.45ns 25.8ns 0 0 0 960 B
master ExecuteAsync net472 2.58μs 1.78ns 6.88ns 0.143 0 0 923 B
#7115 ExecuteAsync net6.0 1.94μs 1.99ns 7.43ns 0 0 0 952 B
#7115 ExecuteAsync netcoreapp3.1 2.38μs 11.7ns 49.7ns 0 0 0 952 B
#7115 ExecuteAsync net472 2.56μs 1.08ns 3.89ns 0.142 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 7.1μs 10.4ns 39ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.69μs 14.1ns 54.6ns 0 0 0 2.9 KB
master SendAsync net472 12.5μs 10.3ns 38.5ns 0.498 0 0 3.19 KB
#7115 SendAsync net6.0 7.12μs 11ns 42.5ns 0 0 0 2.36 KB
#7115 SendAsync netcoreapp3.1 8.5μs 17.9ns 69.5ns 0 0 0 2.9 KB
#7115 SendAsync net472 12.3μs 7.69ns 29.8ns 0.49 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7115

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 1.222 413,700.00 505,700.00

More allocations ⚠️ in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 259.96 KB 247.89 KB -12.07 KB -4.64%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 274.93 KB 258.08 KB -16.85 KB -6.13%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.6μs 212ns 1.6μs 0 0 0 43.83 KB
master StringConcatBenchmark netcoreapp3.1 47.2μs 224ns 838ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 56.8μs 259ns 968ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 458μs 1.08μs 3.89μs 0 0 0 259.96 KB
master StringConcatAspectBenchmark netcoreapp3.1 447μs 6.44μs 63.7μs 0 0 0 274.93 KB
master StringConcatAspectBenchmark net472 410μs 2.07μs 9.27μs 0 0 0 286.72 KB
#7115 StringConcatBenchmark net6.0 41.8μs 217ns 1.08μs 0 0 0 44.03 KB
#7115 StringConcatBenchmark netcoreapp3.1 48.6μs 269ns 1.66μs 0 0 0 42.64 KB
#7115 StringConcatBenchmark net472 56.7μs 144ns 520ns 0 0 0 65.54 KB
#7115 StringConcatAspectBenchmark net6.0 437μs 1.31μs 4.53μs 0 0 0 247.89 KB
#7115 StringConcatAspectBenchmark netcoreapp3.1 505μs 2.05μs 7.68μs 0 0 0 258.08 KB
#7115 StringConcatAspectBenchmark net472 414μs 2.07μs 9.7μs 0 0 0 286.72 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.76 KB 1.7 KB -56 B -3.18%
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑netcoreapp3.1 1.76 KB 1.7 KB -56 B -3.18%
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net472 1.69 KB 1.64 KB -56 B -3.31%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.63μs 2.6ns 10.1ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.44μs 4.38ns 17ns 0 0 0 1.76 KB
master EnrichedLog net472 4.05μs 4.83ns 18.7ns 0.265 0 0 1.69 KB
#7115 EnrichedLog net6.0 2.58μs 0.855ns 3.2ns 0 0 0 1.7 KB
#7115 EnrichedLog netcoreapp3.1 3.7μs 8.11ns 31.4ns 0 0 0 1.7 KB
#7115 EnrichedLog net472 4.07μs 3.21ns 12.4ns 0.245 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑net6.0 4.37 KB 4.31 KB -56 B -1.28%
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑netcoreapp3.1 4.37 KB 4.31 KB -56 B -1.28%
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑net472 4.57 KB 4.51 KB -60 B -1.31%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 123μs 145ns 563ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 126μs 330ns 1.24μs 0 0 0 4.37 KB
master EnrichedLog net472 167μs 161ns 603ns 0 0 0 4.57 KB
#7115 EnrichedLog net6.0 123μs 40.4ns 151ns 0 0 0 4.31 KB
#7115 EnrichedLog netcoreapp3.1 125μs 41.3ns 155ns 0 0 0 4.31 KB
#7115 EnrichedLog net472 165μs 135ns 523ns 0 0 0 4.51 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net6.0 2.32 KB 2.26 KB -56 B -2.41%
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑netcoreapp3.1 2.32 KB 2.26 KB -56 B -2.41%
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net472 2.14 KB 2.08 KB -56 B -2.62%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.94μs 19.3ns 74.6ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.77μs 22.2ns 79.9ns 0 0 0 2.32 KB
master EnrichedLog net472 7.45μs 8.04ns 31.1ns 0.335 0 0 2.14 KB
#7115 EnrichedLog net6.0 4.99μs 5.6ns 21.7ns 0 0 0 2.26 KB
#7115 EnrichedLog netcoreapp3.1 6.82μs 15.7ns 60.7ns 0 0 0 2.26 KB
#7115 EnrichedLog net472 7.58μs 5.41ns 20.9ns 0.302 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.RedisBenchmark.SendReceive‑net472 1.21 KB 1.2 KB -8 B -0.66%
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 1.21 KB 1.2 KB -8 B -0.66%
Benchmarks.Trace.RedisBenchmark.SendReceive‑netcoreapp3.1 1.21 KB 1.2 KB -8 B -0.66%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2.04μs 10.5ns 49.4ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.53μs 11.8ns 47.4ns 0 0 0 1.21 KB
master SendReceive net472 3.28μs 2.71ns 10.5ns 0.178 0 0 1.21 KB
#7115 SendReceive net6.0 1.97μs 8.88ns 32ns 0 0 0 1.2 KB
#7115 SendReceive netcoreapp3.1 2.71μs 5.36ns 20ns 0 0 0 1.2 KB
#7115 SendReceive net472 3.07μs 1.73ns 6.48ns 0.185 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑net472 2.08 KB 2.03 KB -56 B -2.69%
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑netcoreapp3.1 1.69 KB 1.63 KB -56 B -3.32%
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑net6.0 1.64 KB 1.58 KB -56 B -3.41%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.18μs 0.92ns 3.44ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.64μs 23ns 89.3ns 0 0 0 1.69 KB
master EnrichedLog net472 6.67μs 7.28ns 27.3ns 0.298 0 0 2.08 KB
#7115 EnrichedLog net6.0 4.13μs 5.63ns 21.8ns 0 0 0 1.58 KB
#7115 EnrichedLog netcoreapp3.1 5.49μs 23.6ns 91.2ns 0 0 0 1.63 KB
#7115 EnrichedLog net472 6.86μs 4.96ns 19.2ns 0.306 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 704 B 697 B -7 B -0.99%
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 704 B 696 B -8 B -1.14%
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 666 B 658 B -8 B -1.20%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 586 B 578 B -8 B -1.37%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 584 B 576 B -8 B -1.37%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 584 B 576 B -8 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 751ns 3.97ns 22.4ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 953ns 4.42ns 17.7ns 0 0 0 584 B
master StartFinishSpan net472 914ns 0.809ns 3.13ns 0.0912 0 0 586 B
master StartFinishScope net6.0 918ns 0.479ns 1.73ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.15μs 6.24ns 34.2ns 0 0 0 704 B
master StartFinishScope net472 1.09μs 0.174ns 0.652ns 0.104 0 0 666 B
#7115 StartFinishSpan net6.0 754ns 0.672ns 2.6ns 0 0 0 576 B
#7115 StartFinishSpan netcoreapp3.1 955ns 0.719ns 2.78ns 0 0 0 576 B
#7115 StartFinishSpan net472 923ns 0.145ns 0.544ns 0.0876 0 0 578 B
#7115 StartFinishScope net6.0 904ns 4.35ns 17.4ns 0 0 0 696 B
#7115 StartFinishScope netcoreapp3.1 1.19μs 6.24ns 29.9ns 0 0 0 697 B
#7115 StartFinishScope net472 1.09μs 0.153ns 0.551ns 0.103 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 704 B 696 B -8 B -1.14%
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 704 B 696 B -8 B -1.14%
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 666 B 658 B -8 B -1.20%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.02μs 5.36ns 26.8ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.38μs 2.28ns 8.82ns 0 0 0 704 B
master RunOnMethodBegin net472 1.36μs 0.141ns 0.544ns 0.102 0 0 666 B
#7115 RunOnMethodBegin net6.0 1.04μs 0.398ns 1.54ns 0 0 0 696 B
#7115 RunOnMethodBegin netcoreapp3.1 1.43μs 5.69ns 22ns 0 0 0 696 B
#7115 RunOnMethodBegin net472 1.37μs 2.05ns 7.95ns 0.101 0 0 658 B

Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

var dest = testBinFolder / framework / $"LibDatadog.dylib";
CopyFile(source, dest, FileExistsPolicy.Overwrite);
}
var dest = testBinFolder / framework / $"LibDatadog.{ext}";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other thing is that the current code reads as something such as "get the frameworks that we care about, then process them" whereas the more optimized one reads as "process all of the frameworks, then determine whether we care about the framework"

It's really just a readability thing IMO, it may be more performant but I don't think that matters too much for this code in this case.

@andrewlock andrewlock merged commit e26708c into master Jun 20, 2025
131 checks passed
@andrewlock andrewlock deleted the andrew/minor-libddog-updates branch June 20, 2025 12:13
@github-actions github-actions bot added this to the vNext-v3 milestone Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builds project files, build scripts, pipelines, versioning, releases, packages type:refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants