threads / discuss / 31743

Applying git technology to fix the locate command

Subject: Applying git technology to fix the locate command

## tl;dr

2 messages between Oct 7, 2012 and Oct 7, 2012.

replies: 1people: 1as markdown or json

jonsmirl@gmail.com· Oct 7, 2012, 18:39 UTC · lore

I've been using the Dash HUD in Ubuntu and it's performance is terrible to the point of being unusable. So I started top and noticed that it was forking 'locate' and locate was pegging my CPU at 100% while I tried typing into their incremental search.

Next I looked at the mlocate database. It is 350MB on my desktop and indexing 10,388,379 files. Not quite sure why I have 10M files on my desktop - probably because links are making files appear multiple times.

Typing a non-existent string into locate takes over 10s to respond and that's with the db cached in RAM.

jonsmirl@terra:/$ time locate lelelekddmd real 0m10.645s user 0m10.537s sys 0m0.064s

Git has to deal with similar path compression and it responds pretty much instantly. I'm wondering if any of you git gurus could apply some knowledge from git and use it to fix locate?

-- 
Jon Smirl
jonsmirl@gmail.com
jonsmirl@gmail.com· Oct 7, 2012, 19:18 UTC · re: jonsmirl@gmail.com · lore

Re: Applying git technology to fix the locate command

I played around with updatedb.conf to exclude .git files and my /exports directory. I got the db down to 136MB and 4.5s for a null search. This command still needs help. Given that I have the entire db file cached it should be able to respond instantly on a null search.

-- 
Jon Smirl
jonsmirl@gmail.com

← back to recent threads