Delete manifest resource cache for NativeAOT#116471
Merged
jkotas merged 12 commits intodotnet:mainfrom Jul 4, 2025
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
3 tasks
jkotas
reviewed
Jun 10, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jun 27, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Show resolved
Hide resolved
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jul 2, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jul 2, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
Member
Could you please collect some perf numbers so that we understand how much we are giving up here? |
jkotas
reviewed
Jul 2, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
Member
Author
Testing a single assembly with 1000*10KB resources: [Benchmark]
public string[] GetResourceNames() => typeof(Program).Assembly.GetManifestResourceNames();
[Benchmark]
public Stream GetResource567() => typeof(Program).Assembly.GetManifestResourceStream("BenchmarkGround.res.567.bin");Main:
PR:
It even looks an improvement? |
Member
Assembly with 1000 resources is not very typical case. A typical case is <10 resources. |
Member
Author
|
For assembly with 20 resource: main:
PR:
It looks a very little regression, but not much for typical usages. |
jkotas
reviewed
Jul 3, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Show resolved
Hide resolved
Member
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jkotas
reviewed
Jul 3, 2025
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted from #109114.
In coreclr implementation,
PEAssembly::GetResourcealso does a linear search for the resource. A typical caller would also cache the returned resource.The resultant complexity would be O(assembly+resource) not O(assembly*resource), so there's not much concern about time regression.