← Back to team overview

ubuntu-phone team mailing list archive

mapplauncher

 

Hi,

Alberto Mardegan (mardy) has pinged us about the $subject and I think it worth to bring this idea to the community :)

So mardy and zbenjamin (big hands to both) made a study

mardy's findings were ->

"The idea is to turn the application binaries into shared modules, whose exported symbol is their "main" function only (or they can remain as an executable, as long it's a position independent -pie exporting the "main" function). In the .desktop files, we replace the value of the Exec command with something like this: Exec=invoker --type=qt ./myapp "invoker" is a simple client which talks to a daemon over a socket, and instructs the daemon to load "myapp" into its memory and run it. The advantage of doing this, is that the daemon has already forked off into a process which has the Qt libraries loaded, also with the QGuiApplication and QQuickView objects instantiated (and possibly also the ubuntu-ui-toolkit components loaded and compiled). The "--type" parameter selects which daemon to talk to: since we can have different types of applications (Qt, QML, QML with ubuntu components, SDL, Cordova, etc.) we can have more than one daemon (called "booster"), each one serving a specific type of application. We don't need to have all possible types of boosters running; we can optimize just for the most common application types.
As an example, here are the boosters used in Sailfish: [1] [2] [3]
The booster daemons work by forking off into a child process which loads the common libraries and does all the possible initializations. Then it waits for a client (provided by the invoker binary) to connect over a socket, and when this happens the child process loads the desired application and starts running it. The daemon could also read the client's apparmor profile and set it on the child process before starting executing main()."

So I made simple and far from perfect packaging branches for these projects [4] and pushed the source packages to the SDK's Staging PPA [5]

I know that there are security concerns about how the mapplauncherd works. After talking to the main developer (w00t on freenode) and reviewing the code I have learned what the mapplaucnher is doing [7]

If you have any experience or opinion about the topic please bring it up :)

This idea looks very promising and piling off seconds from the app starts is something we all are interest, but obviously not for the price of compromising our platform's security.

cheers,

bzoltan


[1] https://github.com/nemomobile/mapplauncherd
[2] https://github.com/nemomobile/mapplauncherd-qt
[3] https://github.com/nemomobile/mapplauncherd-booster-qtcomponents
[4] https://code.launchpad.net/~ubuntu-sdk-team/mapplauncherd/
[5] https://launchpad.net/~ubuntu-sdk-team/+archive/ubuntu/staging/+packages?field.name_filter=applauncher
[6] http://pastebin.ubuntu.com/11953953/
[7] http://pastebin.ubuntu.com/11953814/


Follow ups