I too am very keen to get a minimal image that can start as quickly as possible 
as this gets us into the realm of running Pharo efficiently on AWS Lambda where 
milliseconds count.

We're not bad (at least in the running) and comparable to other languages like 
GO, but milliseconds do add up and cost money, so any efficiencies are useful.

This thread has raised very interesting info as with the jump to 6.1 I've not 
got a minimal image running reliably yet and the full image does show up that 
there is lots going on, and processes trying to write to a file system that is 
read only in the Lambda case.

Tim

Sent from my iPhone

> On 28 Jul 2017, at 11:54, Denis Kudriashov <[email protected]> wrote:
> 
> 2017-07-28 10:35 GMT+02:00 Esteban Lorenzano <[email protected]>:
>> About the FreeType issue: the fonts we use are already cached in the image 
>> but they still need to be moved to freetype library when starting. 
> 
> Looks suprizing that moving two fonts takes so much time. Do you know what 
> happens during move? 
> I found two cached fonts in image: SourceCode and SourceSans. 
> There is also LucidaGrandeRegular which always loads font from file. But it 
> is only for Mac (look at #canBeInstalled).
> 
>  
>> While speeding up will be cool, the only way to avoid this is to not 
>> initiate freetype fonts (perfectly doable for headless images)
>> 
>> Esteban 
>> 
>> On 28 Jul 2017, at 10:15, Denis Kudriashov <[email protected]> wrote:
>> 
>>>> 6ms startup:true a ClassSessionHandler(ExternalObject)
>>> 
>>> Most time here is taken by ExternalAddress startUp logic:
>>> 
>>> ExternalAddress>>startUp: resuming
>>> ...
>>> instances := self allInstances.
>>>              wordSize ~= Smalltalk wordSize
>>>                     ifTrue: "Implement nulling by becomming all existing 
>>> instances to new (and hence null) pointers of the right size."
>>>                             [wordSize := Smalltalk wordSize.
>>>                              instances elementsForwardIdentityTo: 
>>> (instances collect: [:ea| self basicNew: wordSize])]
>>>                     ifFalse:
>>>                             [instances do: [:addr| addr beNull]]]
>>> 
>>> It scans all instances which is very expensive. And I thing it can lead to 
>>> much more time in bigger images.
>>> Maybe we can perform this cleanup at "prepare for production" script and 
>>> add special flag in image that all externals are already clean. 
>>> 
>>> 
>>> 2017-07-27 14:49 GMT+02:00 Sven Van Caekenberghe <[email protected]>:
>>>> 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.
>>>> 
>>>> Sven
>>>> 
>>>> PS: The code of SessionManager/WorkingSession was very readable, well done 
>>>> Christophe !
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
> 

Reply via email to