Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: Perl slower than java

by anonymized user 468275 (Curate)
on Dec 09, 2010 at 00:24 UTC ( [id://876145]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl slower than java
in thread Perl slower than java

The odd extra bracket isn't the point - it's the maximal iterations in your algorithm that is the issue. Although the suggestion about using one liners inline does save a fair amount. But a really well-conceived algorithm ought to reduce iterations by several orders of magnitude. labelled loops with winning exits might be a start. Also, sorting data once to reduce iterating through is better than always iterating the lot. Even with rand, you could generate blocks of data in advance and sort them, rather than pick up values on the fly.

One world, one people

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found