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

Re: Strings and numbers: losing memory and mind.

by syphilis (Archbishop)
on Sep 28, 2007 at 08:32 UTC ( [id://641488]=note: print w/replies, xml ) Need Help??


in reply to Strings and numbers: losing memory and mind.

Interesting post ... it prompted me to run the following:
use warnings; use Devel::Size qw(size); $str = "123"; $str += 0; # numify $str $num = int("123"); print size($str), " ", size($num), "\n";
On Win32 that outputs 32 16 (56 24 on a 64-bit build of perl). I guess that's a reliable way of determining the memory consumed by both $str (32 bytes) and $num (16 bytes). Zat right ?

Cheers,
Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-20 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found