|Perl: the Markov chain saw
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:
For a 32-bit perl-5.38.0 built using the same MSVC compiler (VS2022) in 32-bit mode:
But even with that 32-bit build of perl, the same issue becomes evident when "1e6" is changed to "2e6":