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 language is retarded"; }, while I find this admirable, I can't see how possibly throwing exceptions could ever be considered a better method. In the interest of providing faster numeric processing methods than are available I'll be parking a new number processing class under my articles, at DWC.Algorithms.NumberUtilities.
Why would I even bother writing these number processing functions to begin with? Well, I create a large number of applications that have to process input from streams. I also write a large number of XML applications. And further, I use regular expressions quite often. In all of these cases you have to process the string result into a number on the back-end. This always has the opportunity to throw an exception. If you have a few thousand numeric strings, and 50 of them throw an exception, you just killed the performance of your application. Not to mention, int.Parse, even without exceptions, is VERY slow. My current algorithm is approximately 4x faster than int.Parse when processing valid integers. It is even faster when int.Parse would throw an exception, somewhere along the lines of 15-20x faster. You can draw an average use case based on how many invalid integers you might parse and determine exactly how much more performant my algorithm would be for your use case.
Note the algorithm is complex, and I am only concerned with US english processing. You should still use int.Parse if you want to numbers under different locales. This is the first iteration of the algorithm, and while I tested against 40 billion numeric strings, it doesn't mean there aren't issues in the algorithm. Let me know if you find any please, and if you actually decide to use this function, let me know in the comments, so I can help determine its beneficial impact on the community and further develop it for use in string->number processing. (Sidenote: This improved a stream processing algorithm I was using from 41 ms down to 28 ms, and that was in the case of no invalidly formatted numbers).