The Trunk: System-codefrau.1205.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

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

codefrau
On Sun, Jan 3, 2021 at 8:11 AM David T. Lewis <[hidden email]> 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 <[hidden email]> 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:


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


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



Reply | Threaded
Open this post in threaded view
|

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

Eliot Miranda-2


On Mon, Jan 4, 2021 at 7:58 PM Vanessa Freudenberg <[hidden email]> wrote:
On Sun, Jan 3, 2021 at 8:11 AM David T. Lewis <[hidden email]> 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 <[hidden email]> 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:


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


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.

Gob smacked.  This is embarrassing.  This needs to be a preference.  I don't mind it being on by default.  But I think both STARTUP and QUIT/No SAVE stamps need to be optional.  I for one find it really annoying that QUIT/No SAVE stamps are added when nothing has occurred (a pain if one's image is under version control, for example).  So I find myself using the Mac's Force Quit, or ctrl-c on the command line.
Then isLowerPerformance would become

      ^StartupTime > LowerPerformanceThreshold

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

Vanessa


--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

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

marcel.taeumel
Hi all!

At the time of writing, the wizard has a hard-coded list of somewhat costly preferences to turn off via #adjustSettingsForLowPerformance. We should check and update that list from time to time.

The check for #isLowerPerformance may also be useful outside the scope of preferences. Well, maybe we can make it check the *remaining* resources for new workload to come. That is, there may already be a Squeak process eating up 99% of the image's resources. Then, any call to #isLowerPerformance should answer "true", of course. Even though we might be on a powerful machine. The current workload matters for the upcoming operations.

Note that the current workload is expected to be low at image-startup time. ;-) So, somehow deriving a performance figure at that time makes sense to me.

Here is a summary of your suggestions:

A) Estimate processor mips from platform specs
+ eem
o mt

B) Take extra measurement via #timeToRun when checking #isLowerPerformance, may be cached
+ dtl
+ tpr
o codefrau
- eem 
- mt

C) Profile image start-up via VM parameter 20 or similarly cheap timestamps
+ ul
+ codefrau
+ eem
+ dtl
+ mt

All in all, we should follow up on Levente's suggestion.

Note that I recently fixed the wizard startup in both Trunk and 5.3 to be 10x faster. Next step is to have the wizard be opened already in a fresh image -- to further speed up the first start.

Best,
Marcel

Am 05.01.2021 05:06:33 schrieb Eliot Miranda <[hidden email]>:



On Mon, Jan 4, 2021 at 7:58 PM Vanessa Freudenberg <[hidden email]> wrote:
On Sun, Jan 3, 2021 at 8:11 AM David T. Lewis <[hidden email]> 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 <[hidden email]> 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:


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


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.

Gob smacked.  This is embarrassing.  This needs to be a preference.  I don't mind it being on by default.  But I think both STARTUP and QUIT/No SAVE stamps need to be optional.  I for one find it really annoying that QUIT/No SAVE stamps are added when nothing has occurred (a pain if one's image is under version control, for example).  So I find myself using the Mac's Force Quit, or ctrl-c on the command line.
Then isLowerPerformance would become

      ^StartupTime > LowerPerformanceThreshold

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

Vanessa


--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

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

David T. Lewis
On Tue, Jan 05, 2021 at 09:58:22AM +0100, Marcel Taeumel wrote:

> Hi all!
>
> At the time of writing, the wizard has a hard-coded list of somewhat costly preferences to turn off via #adjustSettingsForLowPerformance. We should check and update that list from time to time.
>
> The check for #isLowerPerformance may also be useful outside the scope of preferences. Well, maybe we can make it check the *remaining* resources for new workload to come. That is, there may already be a Squeak process eating up 99% of the image's resources. Then, any call to #isLowerPerformance should answer "true", of course. Even though we might be on a powerful machine. The current workload matters for the upcoming operations.
>
> Note that the current workload is expected to be low at image-startup time. ;-) So, somehow deriving a performance figure at that time makes sense to me.
>
> Here is a summary of your suggestions:
>
> A) Estimate processor mips from platform specs
> + eem
> o mt
>
> B) Take extra measurement via #timeToRun when checking #isLowerPerformance, may be cached
> + dtl
> + tpr
> o codefrau
> - eem??
> - mt
>
> C) Profile image start-up via VM parameter 20 or similarly cheap timestamps
> + ul
> + codefrau
> + eem
> + dtl
> + mt
>
> All in all, we should follow up on Levente's suggestion.
>

+1 for using Levente's approach

Dave


12