Add ModuleDefinition.ImmediateRead #713
Loading…
Reference in a new issue
No description provided.
Delete branch "master-immediate-read"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We are going to use this to do a multi stage load in parallel. We will be able to greatly reduce our load times using this new API. The way it's going to work is
Stage 1 - In parallel, load the assemblies with ReadingMode.Deferred.
Stage 2 - Populate our AssemblyResolver with a cache of all read assemblies.
Stage 3 - In parallel, call ImmediateRead.
What I really want is an API to load everything in stage 3. I found that ImmediateRead does not load method bodies. I don't know if/how you want want something like this exposed via the public API. For now I'm iterating the data model and forcing things to load that ImmediateRead did not cover.
@jbevain You didn't include this in the changes you sent to me. I added this for 2 reasons.
It seemed like the easiest way to write a test that meant something.
I saw some other behaviors such as writing and symbol reading checked the reading mode. It seemed like it would be better if the reading mode was updated. However, I'm not certain this is correct. Does this seem sensible to you?
@jbevain Can you take a look?
I updated the PR to more sensibly handle a module with no image. Now ImmediateRead will do nothing if there was no image. Previously it would throw.
@jbevain Does this seem like a change you'd be willing to take?
@ -283,6 +277,27 @@ namespace Mono.Cecil.Tests {}Missing a space before the opening (
I say just move this to
ImmediateRead ()Thanks Mike, please just address the two tidbits and that's good to go!
@ -283,6 +277,27 @@ namespace Mono.Cecil.Tests {}Fixed
Done
Thanks Mike!