in reply to Re^2: How to list files in dir with respect to time ?
in thread How to list files in dir with respect to time ?

I've looked into this now - I was expecting sort to be smart enough to do that manouvre itself. For those who don't understand what it's doing, it is forcing the sort routine to perform the -M operation only once per file, but at the overhead of a hash lookup per sort iteration (there are geometrically upon n sort iterations per n files). sort + block could be optimised for minimal calculation of each side of the <=> operator (or cmp as appropriate) -- after all it ought to know it's going to be doing that irrespective of what's in the block, so it's a safe optimisation for sort to be doing already. But the orcish manouevre appears to be necessary because no such optimisation has been implemented. Perhaps Sort::Key has the manoeuvre already, however.

One world, one people

  • Comment on Re^3: How to list files in dir with respect to time ?

Replies are listed 'Best First'.
Re^4: How to list files in dir with respect to time ?
by salva (Canon) on Aug 17, 2005 at 08:44 UTC
    Perhaps Sort::Key has the manoeuvre already, however

    well, it's not exactly the Orcish manouevre, but Sort::Key calculates every key only once.