@ -1,10 +1,10 @@
/*! \mainpage Optimizing Application S tartup
/*! \mainpage Optimising application s tartup
\section introduction Introduction
The \c invoker program and the \c applauncherd daemon help
applications launch faster and save memory via shared resources and
application type specific initializ ations. The \c invoker uses a
applications launch faster and save memory through shared resources and
application type specific initialis ations. The \c invoker uses a
socket connection to request application launch, and applications are
forked from the daemon process so that they can share memory with the
daemon (and each other) using copy-on-write. The invoker also
@ -27,63 +27,61 @@ of applications.
All functionality of the launcher daemon is accessed using the \c
invoker program. The daemon is usually started automatically as part
of the UI session (e.g. \c upstart in Harmattan and \c uxlaunch in MeeGo ).
of the UI session (for example, \c upstart in MeeGo 1.2 Harmattan ).
The \c applauncherd daemon process links in a set of libraries so that
the launched applications do not need to do linking and symbol
resolution for the libraries at startup. In addition, startup latency
is reduced by doing some initializ ations before application launch.
is reduced by doing some initialis ations before application launch.
When \c applauncherd is started, it forks off a number of \a booster
processes, one for each application type supported by the
launcher. The boosters first do some application type specific but
application independent initializ ation if applicable. For example, the
application independent initialis ation if applicable. For example, the
QML booster instantiates a \c QApplication and a \c QDeclarativeView,
and stores the instances in MDeclarativeCache. Each booster then
starts listening on its dedicated socket.
Applications are launched by using the \c invoker program. The invoker
sends the path of the application binary to the desired booster
process, along with data on its running environment (e.g. command line
process, along with data on its running environment (for example, command line
arguments and environment variables). The booster process loads the
binary, initializ es its environment, and finally calls the \c main()
binary, initialis es its environment, and finally calls the \c main()
function in the binary. If the booster process had instantiated some
objects, they can be picked up from the cache instead of constructing
them at startup. For example, a QML application runner written in C++
can pick up the \c QApplication and \c QDeclarativeView instances from
MDeclarativeCache.
\section gettingstarted Getting S tarted
\section gettingstarted Getting s tarted
This section gives a quick introduction on \c invoker usage and
boosting applications.
\subsection gettingstartedebooster Splash Screen and Single I nstance
\subsection gettingstartedebooster Splash screen and single i nstance
The \c invoker can be used to get a splash screen for the application
and to implement single instance behavior. If the \a exec \a booster
and to implement single instance behaviou r. If the \a exec \a booster
is used, no modifications to the application source code are needed. Simply
specify the name of the splash image on the invoker command line as
follows. For more details see \ref eboost "the exec booster documentation " and
\ref splash "the splash document ation".
follows. For more details, see \ref eboost "Using the exec booster" and
\ref splash "Enabling a splash screen for an applic ation".
\code
invoker --type=e --splash=/usr/share/images/myAppSplash.jpg /usr/bin/myApp
\endcode
If single instance behavior is desired, it can be requested with a
command line option as follows:
To request single instance behaviour, use the following command line option:
\code
invoker --type=e --single-instance /usr/bin/myApp
\endcode
This causes \c invoker to look for a running instance of the
application using a simple lock file based mechanism. If an already
running instance is found, it is brought to the foreground instead of
launching a new instance of the application. See
\ref singleinstance "the single instance documentation" for more
information.
This causes \c invoker to look for a running instance of the application using a
simple lock file based mechanism. If an already running instance is found,
it is brought to the foreground instead of launching a new instance of the
application. See \ref singleinstance
"Enabling single instance support for an application" for more information.
The options can also be combined, in which case the splash screen is
only shown when a new instance of the application is started:
@ -92,7 +90,7 @@ only shown when a new instance of the application is started:
invoker --type=e --single-instance --splash=/usr/share/images/myAppSplash.jpg /usr/bin/myApp
\endcode
\subsection boostingqtquick Boosting Qt Quick A pplications
\subsection boostingqtquick Boosting Qt Quick a pplications
In order to boost Qt Quick applications with \c invoker, some changes
in the application and the way it is built are needed. The process is
@ -101,7 +99,7 @@ details see appropriate documentation below. The \c applauncherd-dev
package needs to be installed to get the necessary headers and
libraries.
We assume a QML application that uses a simple C++ based runner. The
In the following example a QML application uses a simple C++ based runner. The
first step is to modify the application so that it picks up instances
of \c QApplication and \c QDeclarativeView from MDeclarativeCache. To
do this, the include directive for MDeclarativeCache is needed, and
@ -134,30 +132,30 @@ The \c --type=d command parameter specifies that this is a QML application.
invoker --type=d ./qml-helloworld
\endcode
Normally the compiler and linker flags would b e provided automatically
Normally the compiler and linker flags ar e provided automatically
either by using \ref usingpkgconfig "pkg-config" directly, or using it
via \ref usingcmake "cm ake" or \ref usingqmake "qmake".
via \ref usingcmake "CM ake" or \ref usingqmake "qmake".
It is also a good idea to hide any unnecessary symbols in the
application binary to speed up opening it in the booster. How to do
thi s is cov er ed in \ref qmlboost "the QML booster documentation "
and \ref libmeegotouchboost "the MeeGo Touch booster documentation ".
application binary to speed up opening it in the booster. For instructions,
see \ref qmlboost "Using the QML booster"
and \ref libmeegotouchboost "Using the MeeGo Touch booster".
\section reference Reference document ation
\section reference Further inform ation
- How to enable boosted startup for different types of applications:
- \subpage qmlboost "QML"
- \subpage qtboost "Qt"
- \subpage libmeegotouchboost "MeeGo Touch"
- \subpage eboost "Generic booster for all applications "
- \subpage qmlboost "Using the QML booster "
- \subpage qtboost "Using the Qt booster "
- \subpage libmeegotouchboost "Using the MeeGo Touch booster "
- \subpage eboost "Using the exec booster "
- \subpage splash "How to enable splash screen for the application"
- \subpage splash "Enabling a splash screen for an application"
- \subpage singleinstance "How to enable single instance support for the application"
- \subpage singleinstance "Enabling single instance support for an application"
\section tipsntricks Tips and tricks
See separate page for \subpage tipsandtricks
See \subpage tipsandtricks.
*/