Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi

Thanks for all those suggestions, I have implemented chop so far and got a solid 25% saving, even with overhead of reverse. Very worthwhile. Program run time is 5 minutes as one-off, 45 minutes in a full test suite, so 25% is good saving

The responders who mentioned I didn't give much context are of course correct, but I chose brevity. I have all sorts of requirements re scanning the protein strings, and I'm happy with my regexp scans, index's, other such things that use the structure of a ~20 character peptide sequence within the ~400 character protein, those are pretty ok and are not topping the list in the FastProf profile, just the areas where I do a dumb-as-hell one character at a time scan. These inlcude things like scanning all the proteins and looking for an essentially arbitrary logic in the strings, ie. break the protein (as per Trypsin protease) at a K or R, and count the S,T.Y residues in each segment. I don't think there's any way to speed that up with pre-processing and clever mapping and saving results for re-use, you just have to come up with the world's best way to scan down strings one char at a time. That's my take aayway.

I'll keep looking at your replies though, thanks again.


In reply to Re: Efficient walk/iterate along a string by gje21c
in thread Efficient walk/iterate along a string by gje21c

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (7)
    As of 2015-07-05 05:16 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (60 votes), past polls