Re: efficiency question - nested function cals

From: Marc Pelletier (no.email_at_please.com)
Date: 02/22/04


Date: Sat, 21 Feb 2004 20:30:31 -0800

Jon Skeet [C# MVP] <skeet@pobox.com> wrote in
news:MPG.1a9fe093963598e498a1bd@msnews.microsoft.com:

> No, I suspect they will be JIT compiled to the same code.
>
>

You are right. On 10,000 iterations the execution time is virtually the
same.

But I disagree with your other assertion, that I shouldn't worry about
those issues until I find a bottleneck. I am just learning csharp and this
is surely the time to establish good practices in this language. Good
coding style, once established, can carry you far. For example the
execution time in this case is the same, but the unnested version is much
easier to debug.

I've done a few more optimisation tests that gave very confusing results...
see my other post.

Thanks

Marc Pelletier



Relevant Pages