Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 surveying the Monastery: (6)
As of 2014-12-21 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (105 votes), past polls