[squeak-dev] [Vm-dev] The Trunk: System-codefrau.1205.mcz

Vanessa Freudenberg vanessa at codefrau.net
Tue Jan 5 03:58:14 UTC 2021


On Sun, Jan 3, 2021 at 8:11 AM David T. Lewis <lewis at mail.msen.com> wrote:

> On Sat, Jan 02, 2021 at 02:56:49PM -0500, David T. Lewis wrote:
> > Hi Eliot,
> >
> > On Sat, Jan 02, 2021 at 11:10:45AM -0800, Eliot Miranda wrote:
> > >
> > >
> > > > On Jan 2, 2021, at 8:41 AM, David T. Lewis <lewis at mail.msen.com>
> wrote:
> > > >
> > > > ???Hi Vanessa,
> > > >
> > > >> On Fri, Jan 01, 2021 at 09:28:35PM -0800, Vanessa Freudenberg wrote:
> > > >> Hi Dave,
> > > >>
> > > >> I haven???t actually tried it but it seems on a slow platform this
> would
> > > >> delay the first-time startup by however long those benchmarks take,
> right?
> > > >>
> > > >
> > > > No, it would run at most one time per session, and then only if
> someone
> > > > sends #isLowerPerformance. I think thas means it would affect the
> run time
> > > > of the first unit test that someone runs after starting the image,
> but
> > > > otherwise no impact. Certainly it would not be noticable to humans.
> > >
> > > David, put this delay in every startup and use Squeak as a scripting
> > > language and apply the script to every file in your home directory and
> > > yes, it would be noticeable to humans.
> > >
> >
> > I does *not* do that. Apparently I am not doing a good job of explaining.
> >
> >
>
> Regarding startup time, I'm afraid that my explanation did not come across
> well in email, and I apologize for not being clear.
>
> Let me try once more by just quoting the code. At startup time, there is
> a new class var SlowPlatform that is set to nil. Otherwise nothing new
> is done during image startup processing:
>
> SmalltalkImage>>startUp: resuming
>         resuming ifTrue:
>                 [LastStats := nil.
>                 SlowPlatform := nil.
>                 SystemChangeNotifier uniqueInstance notify: Smalltalk
> ofAllSystemChangesUsing: #event:]
>
> Later on, the class var is lazy initialized if and only if someone needs
> to check for isLowerPerformance:
>
> SmalltalkImage>>isLowerPerformance
>         "Some operations - TestCases for example - need an idea of the
> typical performance
>         of the system on which they are being performed."
>         ^ SlowPlatform
>                 ifNil: [ SlowPlatform := (Time millisecondsToRun:[ 25
> benchFib ]) > 200
>                         or: [ (Time millisecondsToRun: [ 64 benchmark ]) >
> 200 ]]
>
> That's all I meant to suggest.
>
> Sorry for the confusion,
>
> Dave
>

Hi Dave,

you are correct for someone who prepares an image that they use over and
over again.

However, for someone using a fresh image that was just created using
ReleaseBuilder, there will be a isLowerPerformance send on startup (via
ReleaseBuilder class>>startUp: with a DeferredTask set by
prepareEnvironment to open the PreferenceWizardMorph which uses its
own hasLowPerformance method to try to make things faster).

Compare this 5.3 image with disabled wizard:

https://squeak.js.org/run/#url=https://freudenbergs.de/vanessa/squeakjs&zip=[Squeak5.3-19452-64bit.zip,SqueakV50.sources.zip]&wizard=false

to the latest trunk (very slow because Sista so no JIT):

https://squeak.js.org/run/#zip=https://files.squeak.org/6.0alpha/Squeak6.0alpha-20147-32bit/Squeak6.0alpha-20147-32bit.zip

and that even has isLowerPerformance = true because we did fix the platform
name check!

If it was using your code then the "Time millisecondsToRun:[ 25 benchFib ]"
would add 600 ms to the startup. Luckily it would bypass the "Time
millisecondsToRun: [ 64 benchmark ]" which would take 4 seconds.

So I'm in favor of Levente's idea, he proposed this:

| vmStartTime uptime |
vmStartTime := Smalltalk vmParameterAt: 20.
uptime := vmStartTime ~= 0 "utcMicrosecondClock at startup in later Spur
VMs"
        ifTrue: [Time utcMicrosecondClock - vmStartTime + 500 // 1000]
        ifFalse: [Time eventMillisecondClock].

... which works in SqueakJS because of the eventMillisecondClock fallback
(vmParameter 20 is 0).

We just would have to decide where in the startup sequence to put this
check, which is slightly tricky. An obvious place would be in
#recordStartupStamp - I just tried it:

recordStartupStamp
      | vmStartTime |
      vmStartTime := Smalltalk vmParameterAt: 20.
      StartupTime := vmStartTime ~= 0 "utcMicrosecondClock at startup in
later Spur VMs"
            ifTrue: [Time utcMicrosecondClock - vmStartTime + 500 // 1000]
            ifFalse: [Time eventMillisecondClock].
      StartupStamp := '----STARTUP----', Time dateAndTimeNow printString, '
as ', self imageName.

... and StartupTime is about 3000 ms. Then isLowerPerformance would become

      ^StartupTime > LowerPerformanceThreshold

where LowerPerformanceThreshold would maybe default to 500? What's the
StartupTime of e.g. a raspberry pi?

Vanessa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210104/037aa59b/attachment.html>


More information about the Squeak-dev mailing list