in reply to How to access each char in a string most quickly?

Can you explain what you are trying to do???

I mean the slowest thing you have is 18K 4.8K char/sec. Why isn't that fast enough?

In Perl the one of the "power hitter" features is the ability to use regex (regular expressions) so that we don't have to deal with looking at individual characters.

I don't see an application here. Your question is meaningless to me unless you tell me what you are trying to accomplish. Help us out with an application question!

  • Comment on Re: How to access each char in a string most quickly?

Replies are listed 'Best First'.
Re^2: How to access each char in a string most quickly?
by llancet (Friar) on Jul 03, 2009 at 03:02 UTC
    I have to process on thousands of 1200-char-length gene sequence, and I have to access each character of it.
      I am saying that getting a character quickly in and of itself is meaningless.

      getc() will do that. There are some ways to get arrays of characters and process them efficiently.

      At the end of the day, you aren't asking "how do I read single characters efficiently?, you want to ask a much broader application question, but you haven't done it yet.

      Your question doesn't have any apparent connection to your intended application.

      Udate: it appears to me that you need to find patterns amongst very long strings. Generating a list of 1,200 chars is not going to help you achieve this objective. getc() is NOT the way. Perl excels at processing sequences of characters, not individual characters.