Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Efficient bit-twiddling in Perl.

by kcott (Abbot)
on Mar 01, 2013 at 08:56 UTC ( #1021191=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
    sub just_shift {
        return ($n >> 18, $n << 46 >> 58, $n << 52 >> 58, $n << 58 >> 58);
    }
    
  2. or download this
    $ pm_bit_twiddle.pl
    and_rshift:    2147883105 => 8193 : 33 : 33 : 33
    ...
    mixed_assign  2182671/s        12%            5%           --       -4
    +6%    -48%
    just_shift    4037158/s       108%           93%          85%         
    +--     -3%
    mixed         4163497/s       114%           99%          91%         
    +3%      --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-09-21 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (166 votes), past polls