Thanks for the reply.
Looks like the only safe way is to cut some classes.
After removing most of the classes in the file (only leave about 14x),
the
boot up time reduces about 6 seconds. So there is still some
improvements.
Now the question is which class to cut and at what cost.
Take browser for example, if I cut the classes of ssl connection,
browser
have to load it when access https pages. But how about other apps
which use
WebView? Do they also have to load ssl related classes again?
And about another idea, because Linux shared libraries (.so) are
shared
among processes, if the loading time of a class is to initialize
shared libs
maybe we can have a separate process to trigger library initialization
instead.
Please correct me if I'm wrong.
Thanks.
of Linux share libraries, maybe it's possible
On Jul 16, 4:03 pm, Dianne Hackborn <
hack...@android.com> wrote:
> Yeah you absolutely can not create any threads in zygote, since it will be
> forking (without exec) from itself, and threads+fork == yucky mess.
>
> Anyway, a large number of the classes it is loading will need to be loaded
> by the system process and some of the apps as they start during boot, so I'm
> not sure how much it would actually ultimately save you to not pre-load
> them.
>
> On Wed, Jul 15, 2009 at 7:59 PM, Jean-Baptiste Queru <
j...@android.com>wrote:
>
>
>
>
>
> > I'm not quite familiar with that part of the startup sequence, but I'm
> > not quite sure about what can happen in parallel with class
> > preloading, and class preloading must complete before zygote can fork
> > into a persistent process (or that'll negate some of the benefits).
>
> > JBQ
>
> > On Wed, Jul 15, 2009 at 7:48 PM, jhc<
chenjen...@gmail.com> wrote:
>
> > > Hi,
>
> > > I have some questions about the preloading.
>
> > > From what I know, this is for reducing the launch time of apps such as
> > > the browser.
> > > And why its done in the zygote is to share between app processes.
>
> > > But the time to do preload take about 10~12 seconds, which is a long
> > > time.
>
> > > I'm wondering is there any way we can make this process quicker.
>
> > > Right now I'm trying to fork a thread in zygote to do this,
> > > but it seems to be not allowed in the framework. Is there any document
> > > about this?
>
> > > Or we can create a service to do this in the background?
>
> > > Any suggestions?
>
> > > Thanks
>
> > --
> > Jean-Baptiste M. "JBQ" Queru
> > Android Engineer, Google.
>
> > Questions sent directly to me that have no reason for being private
> > will likely get ignored or forwarded to a public forum with no further
> > warning.
>
> --
> Dianne Hackborn
> Android framework engineer
>
hack...@android.com