You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
3.0 KiB
85 lines
3.0 KiB
15 years ago
|
README
|
||
|
|
||
13 years ago
|
tdeinit is a process launcher somewhat similar to the
|
||
15 years ago
|
famous init used for booting UNIX.
|
||
|
|
||
|
It launches processes by forking and then loading a
|
||
|
dynamic library which should contain a 'main(...)'
|
||
|
function.
|
||
|
|
||
|
Executive summary
|
||
|
=================
|
||
|
|
||
13 years ago
|
Using tdeinit to launch KDE applications makes starting
|
||
15 years ago
|
a typical KDE applications 2.5 times faster (100ms
|
||
|
instead of 250ms on a P-III 500) It reduces memory
|
||
|
consumption by approx. 350Kb per application.
|
||
|
|
||
|
|
||
|
How it works
|
||
|
============
|
||
|
|
||
13 years ago
|
tdeinit is linked against all libraries a standard KDE
|
||
15 years ago
|
application needs. With this technique starting an
|
||
|
application becomes much faster because now only
|
||
|
the application itself needs to be linked whereas
|
||
|
otherwise both the application as well as all the libaries
|
||
|
it uses need to be linked.
|
||
|
|
||
|
Startup Speed
|
||
|
=============
|
||
|
|
||
13 years ago
|
Starting an application linked against libqt, libtdecore and libtdeui
|
||
15 years ago
|
in the conventional way takes approx. 150ms on a Pentium III - 500Mhz.
|
||
13 years ago
|
Starting the same application via tdeinit takes less than 10ms.
|
||
15 years ago
|
|
||
12 years ago
|
(application without TDEApplication constructor, the TDEApplication
|
||
15 years ago
|
constructor requires an extra 100ms in both cases)
|
||
|
|
||
|
Memory Usage
|
||
|
============
|
||
|
|
||
13 years ago
|
An application linked against libqt, libtdecore and libtdeui started
|
||
15 years ago
|
in the conventional way requires about 498Kb memory.
|
||
|
(average of 10 instances) If the same application is started via
|
||
13 years ago
|
tdeinit it requires about 142Kb. A difference of 356Kb (application
|
||
12 years ago
|
without TDEApplication constructor)
|
||
15 years ago
|
|
||
12 years ago
|
If we take the TDEApplication constructor into account, an application
|
||
15 years ago
|
started in the conventional way takes about 679Kb memory while the same
|
||
13 years ago
|
application started via tdeinit requires about 380Kb. Here the difference
|
||
15 years ago
|
is somewhat less, 299Kb. This seems to be caused by the fact that the
|
||
|
dynamic linker does "lazy linking". We can force the linker to link
|
||
13 years ago
|
everything at startup by specifying "LD_BIND_NOW=true". When tdeinit is
|
||
|
started with this option on, tdeinit is back to its full efficiency, an
|
||
12 years ago
|
application with a TDEApplication constructor now uses 338Kb of memory.
|
||
15 years ago
|
A difference of 341Kb with the normal case.
|
||
|
|
||
13 years ago
|
Adapting programs to use tdeinit.
|
||
15 years ago
|
===============================
|
||
|
|
||
|
The sourcecode of a program does not require any change to take advantage
|
||
13 years ago
|
of tdeinit. Only the makefile requires an adaption, if the Makefile.am of
|
||
15 years ago
|
a normal program looks like this:
|
||
|
|
||
|
bin_PROGRAMS = kicker
|
||
|
kicker_LDADD = $(top_builddir)/libkonq/libkonq.la
|
||
|
kicker_LDFLAGS = $(all_libraries) $(KDE_RPATH)
|
||
|
|
||
|
The following lines need to be added to make a library version useable
|
||
13 years ago
|
by tdeinit:
|
||
15 years ago
|
|
||
|
lib_LTLIBRARIES = kicker.la
|
||
|
libkicker_la_LIBADD = $(top_builddir)/libkonq/libkonq.la
|
||
|
libkicker_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module
|
||
|
|
||
|
Disadvantages
|
||
|
=============
|
||
|
|
||
13 years ago
|
The process name of applications started via tdeinit is "tdeinit". This problem
|
||
15 years ago
|
can be corrected to a degree by changing the application name as shown
|
||
13 years ago
|
by 'ps'. However, applications like "killall" will only see "tdeinit" as
|
||
13 years ago
|
process name. To workaround this, use "kdekillall", from tdesdk/scripts,
|
||
13 years ago
|
for applications started via tdeinit.
|
||
15 years ago
|
|