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

Re: Array vs. Hash for sparsely integer-indexed data

by BrowserUk (Patriarch)
on Jan 25, 2013 at 19:02 UTC ( [id://1015391]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $a[ $_*2 ] = $_ for 1 .. 1e5;;
    $h{ $_*2 } = $_ for 1 .. 1e5;;
    ...
    print total_size( $_ ) for \( @a, %h );;
    69509024
    7526431
    
  2. or download this
    $a[ $_ * 20 ] = $_ for 1 .. 1e5;;
    
    ...
    1359141122.04252
    1359141123.06596
    100000
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-29 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found