#758324 shared-mime-info: huge speedup: sync all files at once instead of syncing them seperately (40s to 1s)

Package:
shared-mime-info
Source:
shared-mime-info
Description:
FreeDesktop.org shared MIME database and spec
Submitter:
Jann
Date:
2024-03-10 15:03:10 UTC
Severity:
wishlist
Tags:
#758324#5
Date:
2014-08-16 21:31:13 UTC
From:
To:
This was filed upstream here: https://bugs.freedesktop.org/show_bug.cgi?id=82711

In update-mime-database, first write all files, then sync all filesystems,
then move all files. The original behavior was very slow for two reasons:

 - After every file creation, we had to wait for the harddisk to complete
   the write.
 - We told the kernel and the harddisk in which order writes should happen.

This reduces the time needed on my harddisk from 44-45s to 0.9-1.4s. More
than an order of magnitude speedup! :)

The only downside I can see is that if update-mime-database is interrupted
for some reason, there are more *.new files in the FS. I don't think that
that's a big problem.