-
Notifications
You must be signed in to change notification settings - Fork 147
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
[WIP] use built-in .NET runtime types instead of vendored types when possible #6726
base: master
Are you sure you want to change the base?
[WIP] use built-in .NET runtime types instead of vendored types when possible #6726
Conversation
1f37cc8
to
6dd35fd
Compare
Datadog ReportAll test runs ✅ 2 Total Test Services: 0 Failed, 2 Passed Test Services
|
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 (6726) - mean (69ms) : 66, 72
. : milestone, 69,
master - mean (70ms) : 65, 74
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6726) - mean (1,002ms) : 979, 1025
. : milestone, 1002,
master - mean (1,008ms) : 978, 1037
. : milestone, 1008,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6726) - mean (103ms) : 100, 105
. : milestone, 103,
master - mean (103ms) : 101, 106
. : milestone, 103,
section CallTarget+Inlining+NGEN
This PR (6726) - mean (675ms) : 658, 692
. : milestone, 675,
master - mean (691ms) : 675, 707
. : milestone, 691,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6726) - mean (89ms) : 88, 91
. : milestone, 89,
master - mean (89ms) : 88, 91
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (6726) - mean (633ms) : 620, 646
. : milestone, 633,
master - mean (648ms) : 634, 663
. : milestone, 648,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6726) - mean (191ms) : 187, 196
. : milestone, 191,
master - mean (191ms) : 186, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6726) - mean (1,108ms) : 1078, 1139
. : milestone, 1108,
master - mean (1,107ms) : 1081, 1132
. : milestone, 1107,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6726) - mean (271ms) : 266, 276
. : milestone, 271,
master - mean (271ms) : 267, 276
. : milestone, 271,
section CallTarget+Inlining+NGEN
This PR (6726) - mean (859ms) : 833, 885
. : milestone, 859,
master - mean (875ms) : 843, 907
. : milestone, 875,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6726) - mean (262ms) : 259, 265
. : milestone, 262,
master - mean (263ms) : 259, 267
. : milestone, 263,
section CallTarget+Inlining+NGEN
This PR (6726) - mean (846ms) : 809, 883
. : milestone, 846,
master - mean (854ms) : 826, 882
. : milestone, 854,
|
57f246c
to
d09bc2e
Compare
d09bc2e
to
0b047b0
Compare
Summary of changes
When targeting .NET Core >= 3.1, do not include the files copied ("vendored") from the .NET runtime. Instead, use the built-in types.
Reason for change
Implementation details
GlobalUsings.cs
, use#if NETCOREAPP3_1_OR_GREATER
andglobal using
to choose namespaces based on target runtime (TFM)internal
.NET runtime APIs with their public counterparts, for example:ArrayMemoryPool
➡️MemoryPool
new ImmutableArray<LocalScope>.Builder()
➡️ImmutableArray.CreateBuilder<LocalScope>()
netcoreapp3.1
ornet6.0
, exclude most of the files in:Note that this PR keeps the files in
Vendors/System.Reflection.Metadata
for now because we access non-public members from that namespace. This namespace makes up about 60% of the bytes in ``Vendors/System.*`. We can tackle this in a future PR.This PR also keeps a few files which are used elsewhere:
Test coverage
No behavior changes expected. All tests should still pass.
Other details
Assembly size comparison
netcoreapp3.1
net6.0
Estimated size per namespace
Before (
net6.0
)After (
net6.0
)