controlflow / resharper-heapview

ReSharper Heap Allocations Viewer plugin
MIT License
304 stars 28 forks source link

"Why is this being suggested" #7

Closed cyotek closed 2 years ago

cyotek commented 10 years ago

For some suggestions, ReSharper offers a "Why is this being suggested" type link.

It would be nice if HeapView offered something similar. For example, I notice it is littering my code with allocations for foreach loops, Where clauses in LINQ statements and more. I'm not really sure what level of developer this tool is geared towards, but some form of hints to explain why something is being listed might help the developer make a more informed decision on if they need to investigate further etc.

Or I could just be being an idiot and missing the point of the tool!

Regards; Richard Moss

mattwarren commented 10 years ago

For the Where clause or LINQ example, take a look at this blog post, in the section titled "A different, better-performing approach". It gives a really good explanation.

Or take a look at some LINQ code in Reflector, with it set to .NET 1.0 mode and you'll see what's really going on behind the scenes

cyotek commented 10 years ago

Thanks for the link - that's an interesting read. I hadn't really considered what goes on "under the hood" when using LINQ. Now it's got me to thinking, which can't be a bad thing!