Browse by Tags

All Tags » Performance » Quick Tips (RSS)

Article on file line counting algorithms. Covering fast exact counting and statistical counting.

Someone asked a question on the C# newsgroup yesterday and a large number of answers have been flying around. Some people actually tend to recommend using a StreamReader to count lines (ouch) since they generally work with small files. The FileStream...

Since I can't stand unvalidated performance claims, I looked up the reason behind IsDBNull performance

If you need to figure out a performance issue you can always just ask me via comments or post something as a question in some feedback. I posted earlier this week that using SqlDataReader indexer methods were much faster if you used the ordinal. The reasoning...

Lightweight Code Gen and mathematical equations.

Using lightweight code gen for dynamic scripting languages is cool and all, but imagine the possibilities for the language of mathematics. Sure you can try to write some generics that handle common tasks, perhaps a generic method or two, but lightweight...

Brad Abrams talks about mutable read-only fields and I attempt to elaborate.

Brad Abrams posts an article on Mutable reference types should not be read-only fields . You really have to think about what this means. In the example he creates a new type, say F, that has some internal data. On another type, he creates a read-only...

DWC.Algorithms.NumberUtilities with the latest hopefuls, a test case runner, and some comments...

So the latest code prop does SByte, Byte, Int16, UInt16, and Int32 parsing. All deprecated methods have been moved to a secondary class to reduce the size of the primary class (statics and whatnot). I've added a licensing agreement, since I want to protect...

Fast Image Loading without asking for the hot-fix or waiting for the service pack...

Omar Shahine is doing some great work on his JPEG Hammer application. He talks about finding some hot-fixes for the System.Drawing.Image class that provide overloads for disabling image verification. While this is inherently unsafe, and you now have to...

Following up on the benefits of continued use of int.Parse...

Alex Campbell followed up with some comments on his blog that he saw the continued use of int.Parse as acceptable because of it's additional parsing abilities to determine if a number truly was an integer. C# if(!FindFunction(IsNumeric)) { return "this...

Improving on System.Random for gaming and simulation

The algorithm for grabbing samples in the System.Random class comes from Numeric Recipes in C, Second Edition. They've made some small changes to how the algorithm is run, to either improve performance, or improve the random characteristics of the resulting...

Performance: Different methods for testing string input for numeric values...

So there was a blog entry about the VB .NET IsNumeric function today. The question was in regards to a C# equivalent. I have two things to say really. First, if you really want the IsNumeric function from VB you can always grab it out of Microsoft.VisualBasic...

Neat JIT performance improvement when using BR or BR_S

If you had your choice of how IL got JIT'ed down to the host processor assembly language, how would your JIT handle unconditional branching with regards to how the IL is laid out? I would think the JIT'er would be a two step processor myself. It would...
More Posts Next page »