MichalStrehovsky / iltrim

MIT License
9 stars 1 forks source link

Parallelize method body scanning #52

Closed MichalStrehovsky closed 2 years ago

MichalStrehovsky commented 2 years ago

In MethodBodyNode class:

In the Trimmer class:

For inspiration, this is where crossgen2 does it, but ours can be much simpler (ignore all those "deferred phase stuff, etc. - we really just want a parallel foreach with a call to scan the method for each element of the list provided as an argument):

https://github.com/MichalStrehovsky/iltrim/blob/4063c2e7929f41faf2b568ed1999f5e1823358df/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs#L550-L639

Please make it possible to run this still singlethreaded (same as crossgen2), because debugging a multithreaded app is a pain (breakpoints hit in all threads).