Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Rosetta Code: Long List is Long

by Anonymous Monk
on Dec 01, 2022 at 01:53 UTC ( [id://11148468]=note: print w/replies, xml ) Need Help??


in reply to Re: Rosetta Code: Long List is Long
in thread Rosetta Code: Long List is Long

On macOS, exiting the script requires 15 additional seconds. This is a great test case for comparing "my" vs "our".

my (%by_count, %by_word); # slow cleanup/exiting $ time perl choroba.pl big1.txt big2.txt big3.txt >cpp.tmp start get properties: 21 secs sort + output: 25 secs total: 46 secs real 1m2.072s user 1m0.182s sys 0m1.885s
our (%by_count, %by_word); # fast cleanup/exiting $ time perl choroba.pl big1.txt big2.txt big3.txt >cpp.tmp start get properties: 21 secs sort + output: 25 secs total: 46 secs real 0m47.062s user 0m45.505s sys 0m1.549s

Replies are listed 'Best First'.
Re^3: Rosetta Code: Long List is Long
by choroba (Cardinal) on Dec 01, 2022 at 11:02 UTC
    What Perl version do you run? The final garbage collecting takes about 6 secs on my Linux machine in both 5.26.1 and blead.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      > What Perl version do you run?

      On macOS, Perl v5.30.2 via perlbrew. The system Perl v5.18.2 is also 15 seconds apart between "my" and "our". Garbage collection is faster on Linux.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (9)
As of 2024-04-23 08:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found