Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

slow program start -> My theory

1 view
Skip to first unread message

Stefan Heimers

unread,
Apr 15, 2001, 6:20:49 AM4/15/01
to
On Systems with low memory (32MB or less), Qt 2.x and especially KDE
applications take very long to start.

My theory:

It's inefficent use of disk-cache.

Test:

Statically link a small Qt Application (eg. richtext-example ). It will
start up much faster than a dynamically linked version.

Explanation:

The statically linked program only contains functions needed to run the
small program. Because it is small, it will fit into disk cache, which will
reduce disk activity and thus reduces load time.

The dynamically linked program will load functions randomly spread around
some large libraries, which don't fit into the limited disk cache of weak
systems. For example it could read a function from the beginning of libqt,
and then the next from the end of libqt. What happens: disk cache contains
the start of libqt, which doesn't help if the next function call goes to
the end of the library.


For large programs, statically linking does not help, because it won't fit
into disk cache anyway. If you run several Qt applications, statically
linking even increases memory usage which makes things even worse.

My proposed solution:

Link libqt in a way that physically aligns functions in order of their
first call at program start for most Qt programs. This will make disk cache
very effective and make programs load MUCH faster. (I would not be
surprised if they load up to three times faster on computers with less than
32 MB)

You could even extend this idea: Create statistics on which functions are
often called in some specific order and group those together.


Unfortunately, I don't have time at the moment to try it myself. But please
let me know what you think of it.


Stefan Heimers

0 new messages