Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: packing and unpacking

by ungalnanban (Pilgrim)
on Mar 12, 2010 at 12:26 UTC ( #828275=note: print w/ replies, xml ) Need Help??


in reply to Re^3: packing and unpacking
in thread packing and unpacking



while(1)
{
print"Thankyou...."
}
--$ugum@r--


Comment on Re^4: packing and unpacking
Re^5: packing and unpacking
by almut (Canon) on Mar 12, 2010 at 13:00 UTC

    BTW, note that using bigint indiscriminately can have a massive performance penalty.  So be sure to always localize it to exactly where you actually need it (by putting extra {...} blocks around those sections).

    #!/usr/bin/perl use strict; use warnings; use Benchmark qw(cmpthese); { use bigint; # code that needs bigint my $r = 0x234; my $t = 0x345; my $x1 = $r << 32 | $t; #print $x1->as_hex; # other stuff that doesn't... # => unnecessarily slow! sub with_bigint { my $x = 1; $x = $x * 4 / 2 - 1 for 1..1000; } } # end of bigint sub no_bigint { my $x = 1; $x = $x * 4 / 2 - 1 for 1..1000; } cmpthese (-1, { with_bigint => \&with_bigint, no_bigint => \&no_bigint, }, ); __END__ Rate with_bigint no_bigint with_bigint 11.3/s -- -100% no_bigint 4073/s 35876% --

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-07-31 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls