Interesting...

The ratio's aren't the same as on my machine, but it appears that substr() is pretty quick on both of our machines.

I don't know a Linux utility for this, but in the Windows world, CPU-Z http://www.cpuid.com/cpuz.php shows a lot of info about processors... It is hard for me to imagine that you don't have at least a multi-threaded processor given the raw speed of your machine for a single thread.

If I run two "number cruncher" apps at once, the performance is not 2x, but rather like 1.4x. I have old memory technology and my machine becomes memory bound. To Windows XP Pro, my machine looks pretty much like 2 CPU's except that 1+1 != 2, only about 1.4! And of course when I do that, my computer turns into a "space heater"!. When the winter gets colder, I run some BOINC project like seti@home, etc. on the theory that I might as well be doing something at least marginally useful while I am generating heat! Anyway this is what I have:(in the scheme of things, a Prescott is a wimp)

Processor 1 (ID = 0) Number of cores 1 (max 1) Number of threads 2 (max 2) Name Intel Pentium 4 Codename Prescott Specification Intel(R) Pentium(R) 4 CPU 3.00GHz Package Socket 478 mPGA (platform ID = 2h) CPUID F.4.1 Extended CPUID F.4 Core Stepping E0 Technology 90 nm Core Speed 3015.1 MHz (15.0 x 201.0 MHz) Rated Bus speed 804.0 MHz Stock frequency 3000 MHz Instructions sets MMX, SSE, SSE2, SSE3 L1 Data cache 16 KBytes, 8-way set associative, 64-byte line si +ze Trace cache 12 Kuops, 8-way set associative L2 cache 1024 KBytes, 8-way set associative, 64-byte line size FID/VID Control no

In reply to Re^6: better (faster) way of writing regexp by Marshall
in thread better (faster) way of writing regexp by jodaka

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.