Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I'm too much of a Java-ignorant to be able to pinpoint the 'real' differences here, but it seems to me that the Java-hashlike construct you're using is quite a different beast than Perl's hashes.

Whereas in Perl you have real arrays of real hashes, and the hashes deep down there _do have_ _stored_ keys _and_ stored values, I somewhat miss the hash keys in the Java code - but I might be wrong.

Obviously, if the basic underlying data structures used in Perl are indeed much more sophisticated/complicated than what's there for it in Java - despite their 'almost alikeness' - the processing time will reflect this difference between the structures used.

Update By rewriting the core of your Perl code as
if ( $gene_to < $gene_from ) { # split # low range first $temp_gene_to_legal_range = [ # { FROM => 0, TO => $ge +ne_to }, # { # FROM => $gene_ +from, # TO => $zone_ +o->{_chromosome_length} # } 0, $gene_to, $gene_from, $zo +ne_o->{_chromosome_length} ]; } else { # single $temp_gene_to_legal_range = # [ { FROM => $gene_from, TO +=> $gene_to } ]; [ $gene_from, $gene_to ] }
the time displayed goes down on my machine from approx. 14.5 to 11.4. Might be that that's another path to follow.

In reply to Re: Benchmarking Simple Perl program vs. Java equivalent by Krambambuli
in thread Benchmarking Simple Perl program vs. Java equivalent by roibrodo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (14)
    As of 2014-08-28 14:15 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (261 votes), past polls