3 ms·
Here is a recent C#/.NET experience that I had: Some of my time is spent profiling/sampling/optimizing the pipeline at work. I decided to take a stab at a C#/.N
by malkia 12y ago
Here is a recent C#/.NET experience that I had: Some of my time is spent profiling/sampling/optimizing the pipeline at work. I decided to take a stab at a C#/.NET tool that is executed quite a lot throughout the day, only to find out some unexpected things - all variables in a functions would be initialized to defaults (used or not, covered or not)... So splitting large functions into smaller would (actually) help in this case for sure:
https://gist.github.com/malkia/ebf7f54063c5aec6d1b0 https://gist.github.com/malkia/ebf7f54063c5aec6d1b0
Some answers from Eric Lippert about it (declaration spaces)
http://blogs.msdn.com/b/ericlippert/archive/tags/declaration+spaces/ http://blogs.msdn.com/b/ericlippert/archive/tags/declaration...
And this stackoverflow:
http://stackoverflow.com/questions/2976628/question-on-c-sharp-variable-scope-vs-other-languages http://stackoverflow.com/questions/2976628/question-on-c-sha...
It's not something I've seen in other languages/vm's. And seems like "ngen install" with some attributes would help it:
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int func1(int flag)
But I'm no longer able to think of C# as closer (not close) to the metal, because of this exactly. It'll affect me how I look at it and code in it.