Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: optimal way of comparing 2 arrays

by jfroebe (Parson)
on Oct 19, 2005 at 20:58 UTC ( [id://501425]=note: print w/replies, xml ) Need Help??


in reply to optimal way of comparing 2 arrays

Hi Narashima,

I just saw your post... the best way is probably to benchmark the comparisons with your data set. I've written up a short script performing two of the comparisons that you list. You should be able to extend it very easily to test all the different variations of comparing two lists.

My tests show that using two grep's is significantly faster than two foreach's. This may or may not be consistant with your real data. I would bet a pretty penny but not my life on it ;-) Maybe it will help you.

Jason L. Froebe

Team Sybase member

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Replies are listed 'Best First'.
Re^2: optimal way of comparing 2 arrays
by narashima (Beadle) on Oct 19, 2005 at 21:20 UTC
    The grep are sure working out to be faster in my case atleast...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found