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

Knoll Lars Lars.Knoll at digia.com
Thu Oct 31 08:38:00 CET 2013


Before going to a binary format, I’d first like to check whether we can further speed up the parsing. I’ve done some work in that area in spring, but I know there was still quite some room to improve it.

Cheers,
Lars

From: Jiergir Ogoerg <f35f22fan at gmail.com<mailto:f35f22fan at gmail.com>>
Date: torsdag 31. oktober 2013 04:10
To: "<development at qt-project.org<mailto:development at qt-project.org>>" <development at qt-project.org<mailto:development at qt-project.org>>
Subject: [Development] Cut 7+ms of Qt5 startup time on Linux

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/f05d0637/attachment.html>


More information about the Development mailing list