[arch-general] Patch for update-mime-info slowness

Rodrigo Rivas rodrigorivascosta at gmail.com
Thu Dec 5 04:30:48 EST 2013


On Wed, Dec 4, 2013 at 9:00 PM, Sébastien Leblanc <leblancsebas at gmail.com>wrote:

> I am kind of annoyed by the time it takes to update the MIME database
> (something like two minutes on a recent i7 quad-core laptop). Until
> pacman has hooks/triggers, I have removed the calls to fdatasync
> (which are supposed to ensure that the files are truly written to
> disk). I prefer letting the system take care of it anyway, and I don't
> care much for consistency in desktop links and file associations.
>

I hadn't noticed, but now I'm annoyed too :-(

>
> Y'know, it might bear the name "database", but it's not a database in
> the sense of a +1M row postgresql database).
>
> Anyone have an opinion on this? Am I a complete idiot in removing
> these calls to fdatasync?
>

Yeah, I think that this is kind of useless. If the files got corrupted, you
can rebuild them running the command again. Maybe I'm losing something
there, but it looks like the ext4-ate-my-data syndrome.

With this patch, updating takes around 5 seconds, haven't run it with
> a stopwatch yet.
>
>
Instead of a patch I've installed the libeatmydata package from the AUR and
added a file /usr/local/bin/update-mime-database that calls `exec eatmydata
update-mime-database "$@"`.

Before: 21.618 s.
After: 0.275 s.

A x100 improvement, that's something!

-- 
Rodrigo


More information about the arch-general mailing list