Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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 :)

Afraits

"The avalanche has started, it is too late for the pebbles to vote"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...