[Development] Mime database size

Thiago Macieira thiago.macieira at intel.com
Thu Feb 19 06:52:38 CET 2015

On Thursday 19 February 2015 01:55:01 Kevin Kofler wrote:
> Arnaud Vrac wrote:
> > Commit fbeeaf2 in qtbase adds QT_NO_MIMETYPE:
> > 
> > "The mime type stuff generates one of the biggest translation units in
> > QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With
> > QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB->4.4MB gcc
> > 4.9 stripped release build)"
> > 
> > It would be nice to be able to find a middle ground between disabling the
> > mime database completely and adding 1.7MB of data to Qt. The
> > update-mime-database binary from the shared-mime-info package can generate
> > a binary file from the XML, which is 100KB large and still allows finding
> > the mimetype of any file. The only difference with the XML is that you
> > don't have the translated pretty string for the mime type. The binary file
> > can also be mmapped and used for every request very efficiently, instead
> > of allocating all mime types data in memory.
> This won't help the other platforms, but on GNU/Linux, can't we just use the
> system shared-mime-info database?

We might not be able to rely on it being there on all systems, but we could 
provide a configure switch that lets distributors say "yes, I confirm it's 
always there, so don't bundle a copy".

Similarly, we can provide a switch that says "all locales are UTF-8, so 
optimise QString::to/fromLocal8Bit".
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Development mailing list