Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Finding oldest file in directory

by theorbtwo (Prior)
on Oct 19, 2004 at 13:16 UTC ( #400505=note: print w/replies, xml ) Need Help??


in reply to •Re^2: Finding oldest file in directory
in thread Finding oldest file in directory

Note that the arguments against a perl-based high-water-mark algorithm don't apply to List::Util::max, which, like sort, is written in C. (The overhead of a function call vs the overhead of other opcodes does, however, apply, but that's a very small difference.)

Replies are listed 'Best First'.
•Re^4: Finding oldest file in directory
by merlyn (Sage) on Oct 19, 2004 at 13:22 UTC
    Yes, I was talking about builtin Perl sort vs a Perl-coded high-water mark. Your List::Util's max doesn't apply in the referenced case (largest file), because max can't be coaxed to doing an indirection, so you'd need a GRT style translation, or else you're back to open coding it, again.

    The point here is that high-water-mark is one strategy, and sorting is another strategy, with different costs depending on the length. The only real takeaway here is Benchmark will know, because you can't always guess.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400505]
help
Chatterbox?
[marto]: hmm, yeah, just thinking that I could really use another of the amazon tablets we got the kids years ago, so I can remove the OS. Long flight to Canada coming up :P
[Corion]: marto: Yeah - on a whim I bought two or three back then, but now that I'm comfortable with putting LineageOS on them, they are not for sale anymore ;)
[Corion]: It's a difficult thing, timing your purchases so that alternative ROMs are available and stable just when the devices go on clearance sale :)
[Corion]: Maybe I should work more on my "price monitoring" framework, or talk to friends to get historic price data for gadgets and employ Machine Learning to predict "device goes on final sale" events :)
[Corion]: That might be a fun project but I have to talk to people on how to best get at historic price data if that's available at all :D

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-05-23 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?