Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
There was a possibly related thread here a few months ago about character repetitions and COW but I can't locate it right now.

It would be interesting to compare with a perl that was built without the COW.
How might that be achieved on Windows ? (In fact, how is it even done on Linux ? IIRC it's fairly easily do-able on *nix but I can't find the relevant documentation.)

On Windows, I'm seeing the same thing, irrespective of whether perl-5.38.0 is built with a mingw-w64 port of gcc or with Microsoft's Visual Studio 2022. Unthreaded builds of perl fare just as poorly as the multi-thread builds.
The one thing that does make a big difference is to use a 32-bit build of perl.
For example, with a 64-bit MSVC-built perl-5.38.0:
>perl time.pl 6.13913488388062 0.530965089797974 v5.38.0
For a 32-bit perl-5.38.0 built using the same MSVC compiler (VS2022) in 32-bit mode:
>perl time.pl 0.0664510726928711 0.0533270835876465 v5.38.0
But even with that 32-bit build of perl, the same issue becomes evident when "1e6" is changed to "2e6":
>perl time.pl 6.67774796485901 1.07769107818604 v5.38.0
Cheers,
Rob

In reply to Re^2: Substitution unexpectedly very slow, in Strawberry by syphilis
in thread Substitution unexpectedly very slow, in Strawberry by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.