flynn Posted August 30, 2005 Posted August 30, 2005 I am writing a string parser and wondering how efficient it is to call the Is* and .Char() methods? Performance is an issue in this case since I need to make multiple passes through the string to 1) remove HTML tags , 2) remove CR-NL's and 3) parse the string for multiple combinations of characters. The strings can be up to 100k in size. In C, I can compare characters using: if str[x] = '\n' ... and it is very fast since there is no function call overhead. At the moment, I am using this type of code. Relatively speaking, how fast is the .Chars() method? I'm assuming I can't view the assembly source like I could with VB6. if (s.chars(x) = "5") then ... Should I be worried about the performance of the Is* methods? Quote
Afraits Posted August 30, 2005 Posted August 30, 2005 If you are performing string parsing - perhaps regular expressions may be useful for you, although more overhead they are quite flexible and powerful and so may work out better in the long run, check the regular expressions for examples and as a place to post questions. For your actual question however I have no idea :) Quote Afraits "The avalanche has started, it is too late for the pebbles to vote"
IngisKahn Posted August 30, 2005 Posted August 30, 2005 Both ways are just as slow. Stick with Regular Expressions. Used with the Compiled option they are extreamly fast. Quote "Who is John Galt?"
Talyrond Posted September 1, 2005 Posted September 1, 2005 If performance is an issue I would use a profiler, you will be amassed where bottle necks occur Talyrond Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.