Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: My Binary Search Perl code takes forever

by Anonymous Monk
on Dec 15, 2007 at 16:07 UTC ( [id://657204]=note: print w/replies, xml ) Need Help??


in reply to Re: My Binary Search Perl code takes forever
in thread My Binary Search Perl code takes forever

Did you try one query (2seconds) or ~500 queries. For about ~500 queries, it takes about 5-7 minuetes. I think this is way too slow. Because, I need to make about 100,000 queries, which takes 1000 minutes (16 hours)....
  • Comment on Re^2: My Binary Search Perl code takes forever

Replies are listed 'Best First'.
Re^3: My Binary Search Perl code takes forever
by Anonymous Monk on Dec 15, 2007 at 16:29 UTC
    "One thing I noticed is that you pass in the array by reference (good idea), but the first thing you do is copy it entirely into a local variable. Why not keep accessing it by reference, like this: (I changed some other things around too)"


    Wow! I keep accessing it by reference, it runs in no time. Fantastic. Thanks a lot.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-19 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found