Startup optimization w.r.t. manifest access in composite mode (#36446)
authorTomáš Rylek <trylek@microsoft.com>
Thu, 14 May 2020 20:19:08 +0000 (22:19 +0200)
committerGitHub <noreply@github.com>
Thu, 14 May 2020 20:19:08 +0000 (22:19 +0200)
commit7debfe4b605a743b61eced52970563b59a4967ea
tree879a64bccfebe7db219b6ea331f4c74b9a3a71b4
parent04708d5b5d25795fac25663886e3b5fa68f3fa3c
Startup optimization w.r.t. manifest access in composite mode (#36446)

During my work on fixing runtime crashes in composite build
with large version bubble enabled I noticed room for startup
perf improvement and a very slight working set optimization:

For component assemblies of a composite image, we can basically
share the cache of those manifest assembly references that
have already been resolved (GetNativeMetadataAssemblyRefFromCache)
within the native image because that is the logical owner
of the manifest metadata.

In the "asymptotic" case of composite images with many
components, the pre-existing behavior was basically
a quadratic O(n^2) algorithm in the number of component
assemblies. This change reduces it to linear in the sense
that all assembly references from the composite image get
resolved only once.

Thanks

Tomas
src/coreclr/src/vm/ceeload.cpp
src/coreclr/src/vm/ceeload.h
src/coreclr/src/vm/nativeimage.cpp
src/coreclr/src/vm/nativeimage.h