I have a large C # project (.NET 2.0) that contains very large chunks of code created by SubSonic. Is an attempt like this causing terrible performance?
for (int x = 0; x < identifiers.Count; x++)
{decimal target = 0;
try
{
target = Convert.ToDecimal(assets[x + identifiers.Count * 2]);
}
catch { targetEmpty = true; }}
What happens if a given field that is transmitted is not something that can be converted to a decimal place, it sets a flag, which is then used later in the record to determine something else.
The problem is that the application literally throws 10,000,000 exceptions, as I parse 30,000 records. The whole process takes almost 10 minutes for everything, and my common goal is to improve this time, and it seemed like a light hanging fruit if its a bad design idea.
Any thoughts would be helpful (be kind, it was a miserable day)
Thank you, Chris