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

Log Viewer Very Slow on Some Logs #514

Closed
naricc opened this issue Jul 6, 2021 · 6 comments
Closed

Log Viewer Very Slow on Some Logs #514

naricc opened this issue Jul 6, 2021 · 6 comments

Comments

@naricc
Copy link

naricc commented Jul 6, 2021

The log viewer can become unusably slow on some not especially big logs. I think this has something to do with large stack traces being in the binlog, but I am not exactly sure where it goes wrong.

Here is an example binlog that produces the problem: https://microsoft-my.sharepoint.com/:u:/p/naricc/Eauc8Kph1P9Mp79fOfQDiYEBKw1sX-k8X4hQH6PiraUJ5Q?e=mwRELS

@naricc naricc changed the title Log View In Ordinately Slow on certain logs Log Viewer Very Slow on some logs Jul 6, 2021
@naricc naricc changed the title Log Viewer Very Slow on some logs Log Viewer Very Slow on Some Logs Jul 6, 2021
@KirillOsenkov
Copy link
Owner

Yes, this is expected, for a huge StackOverflow with 66 thousand lines you'll get slowness like that. Doubt we can do anything about it.

Incidentally, I've seen a stackoverflow in Cecil before, and it has to do with a cycle in assembly resolution.
See related:
KirillOsenkov/MetadataTools#4

https://github.com/KirillOsenkov/MetadataTools/blob/ee6bbe6b6aae78190eea6a7f4d740fbf8b190b80/src/BinaryCompatChecker/Program.cs#L164

@naricc
Copy link
Author

naricc commented Jul 6, 2021

@KirillOsenkov I don't suppose you have any tips for debugging a cycle in assembly resolution? I realized it was a cycle, but I can't figure out what assemblies are involved/how to fix it.

@KirillOsenkov
Copy link
Owner

Sometimes assemblies will reference each other. If you have a custom resolver I'd keep a HashSet around of the assemblies being visited, and for each new assembly first check if it's already in the HashSet before trying to resolve it. Read the file I linked to for details (you'll need a custom resolver). There might be a Cecil bug around it too, I can't remember.

@KirillOsenkov
Copy link
Owner

Of course place a breakpoint in the custom resolver and see which assemblies it gets stuck on, maybe log each assembly as you're visiting it, then inspect the log (printf-debugging).

@KirillOsenkov
Copy link
Owner

Read the issue and the code I linked to in more detail, maybe you'll have some insights. Good luck! If you get really stuck, ping me internally and I can help take a look or maybe connect you to Jb Evain, the author of Cecil.

@naricc
Copy link
Author

naricc commented Jul 9, 2021

I figured it out. I guess we can close this one, unless you think there is some way to solve it.

There is probably a linker issue here to make these types of problems easier to diagnose.

@naricc naricc closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants