Still occurs with Strawberry Perl 5.36.1 and 5.38.0 (see below) although I suspect it is more generic than Strawberry Perl.
Running the code through nytprof shows 1000001 calls to main::CORE:substcont at line 10 take most of the time.
It does not happen when the $x repetition is set to 1e5. There was a possibly related thread here a few months ago about character repetitions and COW but I can't locate it right now.
0.224835157394409
0.228233814239502
v5.22.3
9.92650699615479
0.662662982940674
v5.28.0
8.49285101890564
0.744230985641479
v5.36.1
8.02936911582947
0.788676977157593
v5.38.0
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.