in reply to Re^4: RE on lines read from in-memory scalar is very slow
in thread RE on lines read from in-memory scalar is very slow

The Anonymous Monk post in 11157181 made me wonder if the the memory usage pattern changed with perl versions.

Running against the most recent releases of Strawberry Perl for each major version, the memory usage is low for perls prior to 5.20. From 5.20 (tested with 5.20.3) it shows the large usage pattern.

5.20 is when COW was first on by default. https://metacpan.org/release/RJBS/perl-5.20.0/view/pod/perldelta.pod#Performance-Enhancements

FWIW, the in-memory loop runs faster than the file-read loop for Strawberry Perls 5.16 and 5.18, and then becomes slower after 5.20. The difference is just not so large on non-MSYS2 and Cygwin perls.

  • Comment on Re^5: RE on lines read from in-memory scalar is very slow

Replies are listed 'Best First'.
Re^6: RE on lines read from in-memory scalar is very slow
by Danny (Chaplain) on Jan 23, 2024 at 09:26 UTC
    swl et. al. For consistency, if you want to run my file you can get it at tmp.txt. Not sure if there is another way to share files here.