While that looks impressive and is certianly intersting, you missed my point. Even with that huge difference you are still talking about fractions of a second unless you are dealing with several 1k records at least. If you are only doing 100 matches, or even 1,000 matches you arn't going to see the difference. Are there certain things to optimize for when you are using large strings and large datasets? Of course. Are those optimizations things that you should always keep in mind? I don't think so. In this case I beleive that a clear meaning is better, now either solution might be clearer depending on the situation and the programmer. However my point was that your benchmark shouldn't cause anyone to avoid '?' in general just because of performance. There are certainly cases where you are right (for instance 10k strings that are 200+ characters long.), but I think for most general cases the performance differnce is minor and insignificant.


___________
Eric Hodges

In reply to Re^5: Simple regular expression problem by eric256
in thread Simple regular expression problem by jeanluca

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, 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.