Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Obtaining combinations of hash keys and values

by Anonymous Monk
on Apr 29, 2016 at 09:01 UTC ( #1161860=note: print w/replies, xml ) Need Help??


in reply to Re: Obtaining combinations of hash keys and values
in thread Obtaining combinations of hash keys and values

Thanks! How scalable would this prove to be if thousands of input fragments are used?
  • Comment on Re^2: Obtaining combinations of hash keys and values

Replies are listed 'Best First'.
Re^3: Obtaining combinations of hash keys and values
by Cristoforo (Curate) on Apr 29, 2016 at 18:40 UTC
    For thousands of fragments, your result set could get large. Since you are obtaining 4 results for each combination, the total number of results would come to 4 * the total number of combinations.

    • 4 * C(1000,2) == 1,998,000
    • 4 * C(5000,2) == 12,497,500
    • 4 * C(10,000,2) == 199,980,000
    • 4 * C(20,000,2) == 799,960,000

    I guess you need to know how you want to use/analyze the results. Also if you would want to print the results to a file or store in an array or hash.

    Update: When I ran a test here against a sample fasta file, I generated 124 fragments and stored the combinations in a hash. I had a total memory use of 12,848,152 bytes for the 30,504 combinations (about 421 bytes per combination). So I'd guess that if you had 1000 or more fragments, you would probably exceed your memory.

    When I used an array instead of a hash, the memory used was slightly less, 10,888,016 bytes. (roughly 357 bytes per combination).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2019-05-20 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (123 votes). Check out past polls.

    Notices?