in reply to Basic optimization questions

The second does something different than the other two, so it won't even be considered here.

The third is a proper superset of the first, so it will obviously take some extra time, but I've spent more time typing this then you will ever spend assigning undef to variables.

You're going about optimising completely backwards. Spend time picking the right algorithm over worrying about micro optimisations. Don't spend time fixing problems that don't exist.

Replies are listed 'Best First'.
Re^2: Basic optimization questions
by Anonymous Monk on Sep 24, 2010 at 21:03 UTC

    This is like the traveling salesman worrying about whether to lock the doors himself or to let the electronics do it for him when he hits 20km/h.