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

Re: Efficient array element deletion

by Sinister (Friar)
on Dec 05, 2008 at 07:50 UTC ( #728214=note: print w/ replies, xml ) Need Help??

in reply to Efficient array element deletion

If I have a long array and my goal is to perform some test on each element and remove those elements that fail, what are the best ways to do it from CPU and memory standpoints?

I think preventing those entries from ever making it to the array is far more efficient then pushing them on and then later ''grep-ing'' them out.

Any form of array shrinkage is costly (as has been proved throughout this whole thread).

Comment on Re: Efficient array element deletion

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2015-07-30 02:18 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (269 votes), past polls