|
-
July 24th, 2009, 08:48 AM
#16
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|