git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Applying git technology to fix the locate command

From
jonsmirl@gmail.com <jonsmirl@gmail.com>
Date
Oct 7, 2012, 18:39 UTC
Message-ID
<CAKON4OzyAt-e0Ygj=7+Ze7ywU+RNTsi-Nn5huCnEWy8o=a-EUA@mail.gmail.com>

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
Next: jonsmirl@gmail.com
Message 1 of 2 in “Applying git technology to fix the locate command”
  1. jonsmirl@gmail.comOct 7, 2012
  2. jonsmirl@gmail.comOct 7, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.