tunnelvisionlabs / ReferenceAssemblyAnnotator

IL weaver to add nullability annotations to .NET reference assemblies
MIT License
71 stars 8 forks source link

Use stripped-down resolver for perf (no GAC, deferred reading mode) #54

Closed jnm2 closed 4 years ago

jnm2 commented 5 years ago

Contributes to #53.

Total assembly resolve time is 964 ms (version 1.0.0-alpha.99.g7d2f4a388d):

image

Where alpha.97 took 8328 ms:

image

Total time is now 17.4 seconds:

image

sharwell commented 4 years ago

@jnm2 this is currently failing during integration tests

jnm2 commented 4 years ago

Nice!

jnm2 commented 4 years ago

@sharwell On the master branch, Mono.Cecil is resolving mscorlib from the GAC as the core library for netstandard1.6 reference assemblies (e.g. microsoft.win32.primitives\4.3.0\ref\netstandard1.3\Microsoft.Win32.Primitives.dll).

The failure is due to this PR removing GAC loading which causes module.TypeSystem.Object.Resolve().Module to throw NRE instead of loading mscorlib from Framework64.

jnm2 commented 4 years ago

I think the fix may require the target to resolve the netstandard1.6 core library (netstandard.dll?) and pass the path as a new parameter to the annotator. Going to get the targets PR merged first.

jnm2 commented 4 years ago

Failing with System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\projects\referenceassemblyannotator\tests\.isolatednugetcache\netstandard.library\2.0.3\build\netstandard2.0\ref\netstandard.dll'.

I verified locally that this happens to be fixed if I cherry-pick the first commit of #67.

jnm2 commented 4 years ago

Rebased now that https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/pull/67 is merged (rebasing wasn't needed, but I also wanted to retrigger CI)

jnm2 commented 4 years ago

@sharwell CI passed.