Archive for July, 2007

Playing with IL code

July 31, 2007

This is an interesting post on how to tweak the IL code. And here is an example on how to modify the IL code for a speacial case of tail recursion, to remove the stack overflow error.

Visual Studio profiler : Difference between Elapsed and Application Time

July 19, 2007

I had been struggling to understand what does the  terms mean in the VS profiler. The following two posts helped me to understand

http://blogs.msdn.com/profiler/archive/2004/08/04/208286.aspx

http://blogs.msdn.com/profiler/archive/2004/06/09/152023.aspx

searching text in file using boyer moore algo

July 17, 2007

While looking out for algorithms to search text in a file. I found Boyer-Moore algo to be fastest one, you can get the c# code for the algorithm from http://www.codeproject.com/cs/algorithms/bmsearch.asp

Epsilon

July 11, 2007

Epsilon ε is the fifth letter of Greek alphabet , in calculas an arbitary small positive quantity is denoted as ε.

In dot net Double.epsilon field represents the smallest positive Double value greater than zero.

The field is constant and according to MSDN its value is 4.94065645841247e-324.

Defining variable

July 5, 2007

Can you declare variables on demand? I mean to say whenever in my code, I need a variable- I declare the variable, will this improve the performance of my application?

The answer is no, the CLR defines all the variables of a function at the starting of the funtion,  so no performance benifits etc., this can be checked by reading the IL of the code using ILDASM.