Initial startup delay in 3.2g -- why?

Ned Konz ned at
Wed Apr 3 00:03:30 UTC 2002

On Tuesday 02 April 2002 03:07 pm, John M McIntosh wrote:
> >I've been trying to figure out why stock 3.2g images take about 3 seconds
> > to start processing events (you can see this most easily by watching
> > Squeaky's eyes as you move the mouse, or by clicking on text and looking
> > for the highlight/cursor).
> >
> >With the same VM, the 3.0 images don't exhibit this delay.
> >
> >I see the same delay if I turn sound off in the image.
> >
> >Any suggestions? I don't really feel like using gdb today.
> Mm you could put a print to transcript, or collect the ms clock
> somewhere in
> SystemDictionary>>processStartUpList:

Did that, and found the problem...

99.4% {3270ms} AutoStart class>>startUp

Most of that is here:

  50.9% {1675ms} AutoStart class>>checkForUpdates
    |31.0% {1020ms} HTTPClient class>>determineIfRunningInBrowser
    |  |31.0% {1020ms} StandardFileStream class>>isRunningAsBrowserPlugin
    |  |  31.0% {1020ms} StandardFileStream>>waitBrowserReadyFor:ifFail:
    |  |    31.0% {1020ms} Delay>>wait
    |19.9% {655ms} PasteUpMorph>>install
    |  19.9% {655ms} PasteUpMorph>>displayWorldSafely

and here:

  48.5% {1596ms} AutoStart class>>checkForPluginUpdate
    29.2% {961ms} HTTPClient class>>determineIfRunningInBrowser
      |29.2% {961ms} StandardFileStream class>>isRunningAsBrowserPlugin
      |  29.2% {961ms} StandardFileStream>>waitBrowserReadyFor:ifFail:
      |    29.2% {961ms} Delay>>wait
    19.3% {635ms} PasteUpMorph>>install
      18.7% {615ms} PasteUpMorph>>displayWorldSafely

So, some questions:

1. Why do we have to ask twice (spending a second each time) whether
   we're running in the browser when we have a global to record that fact?

2. Why do we call PasteUpMorph>>install twice (for 650msec each time)?

It looks like we could save about 1.5 seconds if we just did each once.

And then:

3. Isn't there a faster way (under Unix at least) to see if we're running in 
the browser environment? Like an environment variable or something?

  Can't the plugin code set a global?

Ned Konz
currently: Stanwood, WA
email:     ned at

More information about the Squeak-dev mailing list