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.