We have have a block of code that generates a lot of exceptions (IndexOutOfRangeException apparently). It's possible that it generates up to 50,000/sec. They are caught but the cpu really spikes. The code block simply checks an IDataRecord for a column. The block is very generic though and if the column isn't there, the exception is caught and returns a boolean.
If it weren't for the number of exceptions this wouldn't be an issue. The only way I can think to fix this is to iterate through the columns of the IDataRecord to see if the column is there before processing, but this also seems like it could be an expensive step because this is a very high traffic application and you would have this loop before accessing any column.
I'm just looking for some thoughts.