Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Rosetta Code: Long List is Long

by Anonymous Monk
on Dec 01, 2022 at 01:53 UTC ( #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? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2023-02-01 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (15 votes). Check out past polls.

    Notices?