Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2014-07-25 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls