Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Efficient array element deletion

by Sinister (Friar)
on Dec 05, 2008 at 07:50 UTC ( [id://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).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found