Browse by Tags

Misconception on the efficient for loop
Published 04-29-2006 12:21 PM | jokiz
I have posted an entry on my blog on how to have an efficient for loops by storing the length before the loop rather than having indirections on the bound checks (which are always executed in the c world). I just read Brad Adams post which confirms that...
Filed under: ,
avoid P/INVOKE or COM Interop if possible
Published 02-09-2006 6:09 PM | jokiz
i was debugging this activex control used in my current project when i bumped into this wrapper class for an interop with kernel32.dll methods. after browsing the documentation, it says that the following functions are provided for win16 support. how...
IS and AS operator
Published 06-11-2005 6:04 PM | jokiz
Boxing and unboxing in C# has a performance cost and the use of the IS and AS operator in casting objects is trivial for me. I thought before that: [code language="C#"] if (boxed is Person) { Person unboxed = boxed as Person; //do something } [/code]...
Filed under: , ,
Disabling method inlining of the CLR
Published 04-01-2005 3:25 PM | jokiz
I am currently reading Richard Grimes’ Fusion WorkShop and in the article he talks about method inlining used by the runtime to optimize execution. I have read this behavior of the CLR but I have never read a way on how to disable this, until he suggested...
Filed under: , ,
Efficient For Loop
Published 03-17-2005 7:13 PM | jokiz
[code language="C#"] for (int i = 0; i < collection.Count; i++) { //do something with collection } [/code] I’ve done this before and for me, the efficient way is to store the Count property of the collection rather than access it everytime for the...
Filed under: , , ,