Skip to content
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

Make FileInfo/DirectoryInfo.Name lazy #73983

Merged
merged 1 commit into from
Aug 17, 2022
Merged

Conversation

stephentoub
Copy link
Member

We can delay the string allocation until it's actually requested.

Separated out of the already-approved #73942.

We can delay the string allocation until it's actually requested.
@ghost
Copy link

ghost commented Aug 16, 2022

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

We can delay the string allocation until it's actually requested.

Separated out of the already-approved #73942.

Author: stephentoub
Assignees: stephentoub
Labels:

area-System.IO

Milestone: -

@danmoseley
Copy link
Member

Failures related to the current upload issues

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM!

@danmoseley
Copy link
Member

danmoseley commented Aug 17, 2022

#74049
also this infra flakiness - I'll paste the info for future discovery, but not open an issue since it's not worth investigation unless it starts happening repeatedly..

NuGet.Protocol.Core.Types.FatalProtocolException : Unable to load the service index for source https://api.nuget.org/v3/index.json.
---- System.Net.Http.HttpRequestException : An error occurred while sending the request.
-------- System.IO.IOException : Unable to write data to the transport connection: Broken pipe.
------------ System.Net.Sockets.SocketException : Broken pipe
Stack Trace
   at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
   at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
   at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
   at NuGet.Protocol.DependencyInfoResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
   at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
   at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.GetPackageDependenciesAsync(PackageIdentity packageIdentity, NuGetFramework targetFramework, ImmutableArray`1 repositories, SourceCacheContext cacheContext, ILogger logger, Builder dependencies, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 569
   at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveCoreAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 227
   at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 197
   at Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.ResolveAsync(String language, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs:line 174
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateSolutionAsync(ProjectId projectId, EvaluatedProjectState projectState, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1235
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateProjectImplAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1050
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.CreateProjectAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1029
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.GetSolutionAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 1007
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.GetSortedDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, ImmutableArray`1 analyzers, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 890
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, DiagnosticResult[] expected, IVerifier verifier, CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 273
   at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs:line 304
   at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) in /_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs:line 181
   at System.Text.RegularExpressions.Tests.CSharpCodeFixVerifier`2.VerifyCodeFixAsync(String source, String fixedSource, ReferenceAssemblies references) in /_/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/CSharpCodeFixVerifier`2.cs:line 36
   at System.Text.RegularExpressions.Tests.CSharpCodeFixVerifier`2.VerifyAnalyzerAsync(String source, ReferenceAssemblies references) in /_/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/CSharpCodeFixVerifier`2.cs:line 25
   at System.Text.RegularExpressions.Tests.UpgradeToGeneratedRegexAnalyzerTests.NoDiagnosticsForNet60(InvocationType invocationType) in /_/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/UpgradeToGeneratedRegexAnalyzerTests.cs:line 159
--- End of stack trace from previous location ---

@danmoseley danmoseley merged commit 96d1c8e into dotnet:main Aug 17, 2022
@DrewScoggins
Copy link
Member

Arm64-Ubuntu Improvements: dotnet/perf-autofiling-issues#8018

@stephentoub stephentoub deleted the fileinfoname branch August 28, 2022 00:46
@ghost ghost locked as resolved and limited conversation to collaborators Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants