[Development] Cut 7+ms of Qt5 startup time on Linux

Jiergir Ogoerg f35f22fan at gmail.com
Thu Oct 31 04:10:29 CET 2013


Hi,

Since each qt (gui) app on Linux parses the text file
/usr/share/X11/locale/en_US.UTF-8/Compose
line by line which on my computer is 549Kib (almost 6000 lines)
it takes on my 64bit OS with Intel Core i5 about 7ms to parse,
so the idea is to cache the locale file in binary format in the
home/.kde directory (the binary file is also smaller than the other one),
this new way takes less than 1ms to load since
there's pretty much nothing to parse.
That's the core idea.
The user's locale changes (very) rarely if at all, so pretty
much all the time he'll load the cached (quick) version,
but when the locale does change or gets updated -
the cache is updated accordingly.

If this approach isn't good stop reading here and please let me
know.

I attached the 2 files in zip format.

The source code is rather dirty cause it doesn't strictly adhere
to the Qt coding style - my goal was a working solution.

Since I don't represent any company and the changes are simple
would somebody please take the changes and shape them into a
mergeable commit or must I take all the steps to become an
official contributor and polish the code to a mergeable state myself?

Only 2 files affected:
/qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
and
/qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131031/c01a0f1d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtablegenerator.h.zip
Type: application/zip
Size: 7781 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131031/c01a0f1d/attachment.zip>


More information about the Development mailing list