feature request: QMimeDatabase support
Description
Currently on Linux, recollindex uses xdg-mime
to determine mimetype
of a file with an unknown or missing extension, with file -i
as a fallback:
Qt5 supports mimetype identification with QMimeDatabase:
https://doc.qt.io/qt-5/qmimedatabase.html#mimeTypeForData
Since recoll already uses Qt5, it would be nice if recollindex also supported QMimeDatabase or even made it the default.
Discussion
Since xdg-mime
is mostly just a wrapper script, it hands off duties
to kmimetypefinder5
, gio
, or mimetype
depending on desktop.
This means that not only is recollindex spawning many processes
and waiting for them to finish,
those child processes are spawning a new process as well.
For kmimetypefinder5
it ends up using QMimeDatabase anyway.
When I poked around with strace
I saw recollindex
spending a lot of time in long futex
calls.
I don't have the numbers to prove it,
but I suspect that process creation overhead
is a large proportion of the CPU cost for recollindex.