Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^3: Something eq hashref key

by hdb (Monsignor)
on Mar 25, 2019 at 14:17 UTC ( #1231660=note: print w/replies, xml ) Need Help??

in reply to Re^2: Something eq hashref key
in thread Something eq hashref key

In a recent thread it was shown that hash slices are not faster than maps, exists on hash slices is not needed.

sub slex { my $h = shift; return map { exists $h->{$_} || 0 } @_ } my %h = map { $_ => 1 } 'a'..'t'; my @bool = slex \%h, 'a'..'z'; print "@bool\n";

Replies are listed 'Best First'.
Re^4: Something eq hashref key
by LanX (Sage) on Mar 25, 2019 at 14:59 UTC
    You must be joking! (?)

    The benchmark was about non intuitive performance of constant lists.

    Slices are 5 times faster than maps in this example, and the overhead of join is still included

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-10-03 21:49 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (15 votes). Check out past polls.