I have a simple sub within a project that is executed about 2 or 3 x 10^6 times during processing of data stored in txt files. It basically does something like the following.

StrArray = Split(Str, ",") - Line results in StrArray with a length of about 12
RetVal1 = CINT(StrArray(0))
RetVal2 = CDBL(StrArray(1))
RetVal3 = DateTime.ParseExact(StrArray(2), "FormatStr", CulturalInfo)
...and a few more lines like the last three. I'm going by memory, but there isn't much more than that really.

The values Ret1, Ret2(...) are ByRef variables that are not reinitiated within the sub every time it is called.

That's about it. The result is a couple minutes of processing time, which is beyond my patience reserves. The Split() function seems to take the most amount of time.

I can't think of any way of speeding this up other than creating a non-managed DLL using C++. Would that be substantially quicker? I haven't used C++ much (the last version I ever used was Borland 2.0) but I imagine I could figure out some simple code like this. Would it be much of an improvement? Is there a better/easier way to speed this up?

Thanks.