Bug: LINQPad freezing when interacting with many collapsible results
Enumerable.Range(0, 200).SelectMany(i => Enumerable.Range(0, 100).Select(j => (i, j))).GroupBy(x => x.i)
Run the script and collapse one of the inner groups. The group will collapse immediately and all of LINQPad will freeze for minutes.
This is a contrived example but in a real-world situation, this is not a great experience.
Comments
I can't reproduce this in LINQPad 8 or LINQPad 5. Can you provide more info? Can you reproduce this on another machine?
Hmm, you're right. This was on my work computer, don't know if that would make a difference. Trying on my personal computer seems to be fine.
But it got worse the larger the inner groups were. I'll report back Monday when I get a chance to try again.
It seems like Windows Defender was scanning things after interacting with the results. There wasn't a lot of excessive CPU activity except from Windows Defender. Probably because it's using the retail Edge WebView? I could understand wanting to scan for browser activity for malicious stuff. I'll see what I can do to reduce the scanning, maybe exclude WebView and linqpad from scans. (so far, nothing)
That's strange. The expand/collapse buttons execute a JavaScript function on the page that updates the styles of elements in the table. It doesn't inject or remove any DOM elements, so I wouldn't expect it to trigger antivirus scanning.
I tried looking around to see if it was specifically a WebView issue and most of what I could find has it crash entirely, rather than slow down like I've been seeing. I do use Edge as my default browser and have no problems opening up saved result files in Edge and interacting with the elements. It seems like it's not liking something about the integration.
Is it possible to try to have the results be rendered by an actual browser instead? Just for testing purposes.
I'm not sure how else to diagnose what the issue could be. I tried looking through Process Monitor logs and couldn't find anything too far out of the ordinary when this happens. All I see in task manager is WebView CPU usage spikes a bit and there's some Windows Defender activity.
Just wanted to confirm, this is not a LINQPad issue. Apparently it was all Windows Defender scanning the process as I was using it. It was happening before and it's currently not happening now, I guess the scans were finished. It may come back and I'll have to just deal with it.
Thanks for the update.