mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Ghastly use of locate


Chronological Thread 
  • From: K B <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Ghastly use of locate
  • Date: Mon, 28 Jun 2010 17:20:04 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=N3g5tnt31D8UGaCMNBvnbPQmXVx2BoHPxkehOU/MdOJdcjjFAVoZ/egsaAPziYC7e1 /Gag7QOpQbf7+cNq+WDQV7h4VBCRWV9MHYP9ix0jRMD9JVw1RmvEtqe2frROm1Y6xWxG Zmp1ESYrjjAVdSSIpNmFUXgZiLRG2kwi2yqRE=

I have arial.ttf, and locate runs in about 100 ms for me. I'll grant
you that it's annoying the FIRST time I use a new font type because it
has to fetch all the sub-styles, but after that, they get cached and
it's very fast.

On Thu, Jun 24, 2010 at 3:07 PM, Sam Liddicott <address@hidden> wrote:
>  On 24/06/10 17:35, Andrey G. Grozin wrote:
>>
>> On Thu, 24 Jun 2010, Sam Liddicott wrote:
>>>
>>> Now texmacs is pleased to run "locate /arial.ttf" on a regular basis
>>> which takes about 20 seconds.
>>
>> Why does it take so long?? Do you have PC XT? On my veeery slooooooow
>> eeepc it returns immediately (finding nothing, admittedly).
>
> That'll be why it is so quick.
>>
>> Do you regularly run updatedb via cron? (I use fcron; if the laptop was
>> switched off at night when updatedb should have been run, fcron runs it
>> after I switch it on the next day).
>
> I'm using mlocate with an up to date database of 525MB
>
> I guess that's why it takes so long.
>
> For the benefit of others I post a corrected version of my locate cacher
> (kept in /usr/local/bin/locate) - the one I posted recursed itself!
>
> #! /bin/bash
>
> ARGS=`echo "$*" | sed -e "s/[^a-zA-Z0-9]/-/g"`
> CACHE=/tmp/locate-$USER-$ARGS
> test -r "$CACHE" && exec cat $CACHE
>
> if /usr/bin/locate "$@" > "$CACHE.tmp"
> then mv "$CACHE.tmp" "$CACHE"
>     exec cat "$CACHE"
> else r=$?
>     cat "$CACHE.tmp"
>     rm "$CACHE.tmp"
>     exit $r
> fi
>
> --
> *Sam's signature*
>



Archive powered by MHonArc 2.6.19.

Top of page