> On 28 Jul 2017, at 09:56, Christophe Demarey <[email protected]> 
> wrote:
> 
> Hi Sven,
> 
>> Le 27 juil. 2017 à 14:49, Sven Van Caekenberghe <[email protected]> a écrit :
>> 
>> Hi,
>> 
>> I instrumented WorkingSession with a log collection that holds timing info 
>> for each #startUp: executed. In a clean Pharo 6 image, 62 were run. Most of 
>> them resulted in a 0ms execution time (#millisecondsToRun: i.e. they were 
>> faster than 1ms). Here is the list of the non zero ones:
>> 
>> 1ms startup:true a ClassSessionHandler(ProcessorScheduler)
>> 1ms startup:true a ClassSessionHandler(OSPlatform)
>> 6ms startup:true a ClassSessionHandler(ExternalObject)
>> 1ms startup:true a ClassSessionHandler(DiskStore)
>> 5ms startup:true a ClassSessionHandler(SmalltalkImage)
>> 9ms startup:true a ClassSessionHandler(DisplayScreen)
>> 1ms startup:true a ClassSessionHandler(Cursor)
>> 41ms startup:true a ClassSessionHandler(FT2Handle)
>> 238ms startup:true a ClassSessionHandler(FreeTypeSettings)
>> 1ms startup:true a ClassSessionHandler(WorldMorph)
>> 14ms startup:true a ClassSessionHandler(OmSessionStore)
>> 
>> For a total of 318ms
>> 
>> I think being able to inspect the WorkingSession and see this list (ordered, 
>> with timing info) would be generally useful (and low cost). Even headless, 
>> we could access the list using eval.
> 
> Yes, it is a nice feature.

I basically did something similar to what Phil/Clement seem to have done:

- added a local instance variable #log to WorkingSession holding an 
OrderedCollection
- instrument #runStartup: and #executeDeferredStartupActions: like this

runStartup: isImageStarting
        self
                runList: manager startupList
                do: [ :each | | ms |
                        ms := Time millisecondsToRun: [ each startup: 
isImageStarting ].
                        log add: { ms. #startup:. isImageStarting. each } ].
        self executeDeferredStartupActions: isImageStarting

but if we do this for real, we better use a real object (like a log event, like 
SessionActionExecuted)

> Do you have the same thing for #shutdown: ?

I considered that, but if the session shuts down, it will disappear, hence the 
log will be lost, no ? Unless we also write it (optionally) to a file.

>> Sven
>> 
>> PS: The code of SessionManager/WorkingSession was very readable, well done 
>> Christophe !
> 
> Thanks but then you should also thanks Guille and Pablo as it was a joint 
> work ;)

Thank you Guille and Pablo !!


Reply via email to