Skip to content
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

same as #1430 appear again #1513

Closed
terrylao opened this issue May 14, 2019 · 3 comments · Fixed by #2766
Closed

same as #1430 appear again #1513

terrylao opened this issue May 14, 2019 · 3 comments · Fixed by #2766

Comments

@terrylao
Copy link

please refer to #1430 and its attachment, the slow save code appear again

@terrylao
Copy link
Author

ILSPY 2.4.0.1963 spent 14.8 seconds.
5.0.0.4772-preview1 suddenly spent 24.5 seconds to complete
5.0.0.4794-preview2 suddenly spent21.6 seconds to complete
when i make this issue, version 5 cannot complete, but after use ver 2.4.0.1963, they can completed.

@dgrunwald
Copy link
Member

I cannot reproduce this with the current version:
5.0.0.4932-preview3 takes 18 seconds on my machine (release build of ILSpy).
A debug build of the same ILSpy version takes 50 seconds for me, but that's normal as the debug builds perform a ton of additional consistency checks.

That ILSpy 5 is slower than ILSpy 2 is normal -- ILSpy 2 was mostly just guessing the corresponding C# code, and would often get it wrong. ILSpy 3+ use a more accurate approach -- ILSpy actually now contains half a C# compiler implementation, for example it tries to re-compile any decompiled function calls to check if the generated code will call the correct overload (if not, it inserts additional casts). This improved accuracy costs a lot of CPU time, so ILSpy 5 being a bit slower than ILSpy 2 is expected.

@dgrunwald
Copy link
Member

Looking at the profile for your assembly, I think a significant speed up is possible if we already construct simple trees in ILReader, so that we don't need to generate as many StackSlot variables and ILInlining doesn't have to work as hard.
But that will require a pretty significant rewrite of the ILReader (which is already planned for other reasons, see #901)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants