"be consistent" | |
PerlMonks |
Re: Benchmarking Simple Perl program vs. Java equivalentby Krambambuli (Curate) |
on Jun 19, 2010 at 11:25 UTC ( [id://845527]=note: 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 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 Section
Seekers of Perl Wisdom
|
|