Re: Help parsing gigantic text files (64 MB+ )
I figured it out. RegEx are slow. Period.
I got rid of my RegEx and just used IndexOf(). Even if I need to do multiple searches on the same line to qualify / disqualify, it is MUCH faster than a single RegEx. Even simple RegEx like "MyNameIsBob" is much slower done as a RegEx vs IndexOf().
Now that I have changed over and gotten rid of them, it is parsing this file very quickly.
The moral is:
Do not use a RegEx unless you absolutely have to. They are very, very slow compared to a simple string search, or even several string searches.
Re: Help parsing gigantic text files (64 MB+ )
Quote:
Originally Posted by
DeepT
They are very, very slow compared to a simple string search, or even several string searches.
You've no idea how RegEx work, it would seem. IndexOf will always be faster but much less capable.
The moral is:
Use the right tools for the job