-
Couldn't load subscription status.
- Fork 5.2k
Delete manifest resource cache for NativeAOT #116471
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
Conversation
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
...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
...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
Could you please collect some perf numbers so that we understand how much we are giving up here? |
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
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? |
Assembly with 1000 resources is not very typical case. A typical case is <10 resources. |
|
For assembly with 20 resource: main:
PR:
It looks a very little regression, but not much for typical usages. |
...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
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
...on/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.ManifestResources.cs
Outdated
Show resolved
Hide resolved
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.
LGTM. Thank you!
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.