in reply to Re: •Re: Keeping only the $n newest files/directories in a diretory?
in thread Keeping only the $n newest files/directories in a diretory?

Is the ST really worth the effort here?

I can understand the "premature optimization" argument here, but I can also understand it if merlyn (Randal Schwartz) types the top two lines of this optimization in his sleep, or at least with a single keystroke. ;)

While the /proc filesystem is not actually a filesystem as such, and a clone in /var would probably not have -M issues, either, the same pruning script would be useful in many different circumstances. If trying to run it on a slower link, such as an SMB mounted share across the corporate campus, on a per-hour cron job, I'd definitely want such an optimization.

--
[ e d @ h a l l e y . c c ]

  • Comment on Re: Re: •Re: Keeping only the $n newest files/directories in a diretory?

Replies are listed 'Best First'.
Re: Re: Re: •Re: Keeping only the $n newest files/directories in a diretory?
by Juerd (Abbot) on Apr 19, 2003 at 13:51 UTC

    I can also understand it if merlyn (Randal Schwartz) types the top two lines of this optimization in his sleep

    So do I. Which is the reason I commented. Yesterday someone said the same thing to me about another ST: is it really worth the effort and memory usage? What he said made sense: an ST uses a lot of memory and in many cases the win is too small to be relevant.

    If trying to run it on a slower link, such as an SMB mounted share across the corporate campus

    You may be right about this one. I don't know how SMB is implemented and whether any client side caching is (can be) done.

    a per-hour cron job

    In a per-hour cron job it doesn't matter. Even in a per-minute cron job, I'd argue that the difference between half a second and half a second is very small :)

    Juerd
    - http://juerd.nl/
    - spamcollector_perlmonks@juerd.nl (do not use).