[squeak-dev] The Trunk: Morphic-ul.744.mcz

Levente Uzonyi leves at elte.hu
Fri Sep 26 18:24:34 UTC 2014


On Fri, 26 Sep 2014, Nicolas Cellier wrote:

> So you rely on (nil value -> nil).
> Will (is) the difference be still significant in Spur?

#value is just a message implemented in Object as ^self. It's also a 
special selector, because it has its own bytecode, but I don't think 
that makes any difference here.

These seemingly minor changes make [Browser open] about 15% 
faster on my machine.


Levente

> 
> 2014-09-26 17:11 GMT+02:00 <commits at source.squeak.org>:
>       Levente Uzonyi uploaded a new version of Morphic to project The Trunk:
>       http://source.squeak.org/trunk/Morphic-ul.744.mcz
>
>       ==================== Summary ====================
>
>       Name: Morphic-ul.744
>       Author: ul
>       Time: 22 September 2014, 7:45:55.442 pm
>       UUID: 78178a2f-f249-4767-8429-f8236e1459bc
>       Ancestors: Morphic-cmm.743
>
>       - sped up #valueOfProperty:ifAbsent: and friends
>
>       =============== Diff against Morphic-cmm.743 ===============
>
>       Item was changed:
>         ----- Method: Morph>>valueOfProperty:ifAbsent: (in category 'accessing - properties') -----
>         valueOfProperty: aSymbol ifAbsent: aBlock
>               "if the receiver possesses a property of the given name, answer
>               its value. If not then evaluate aBlock and answer the result of
>               this block evaluation"
>       +
>       +       extension ifNil: [ ^aBlock value ].
>       +       ^extension      valueOfProperty: aSymbol ifAbsent: aBlock!
>       -       ^ extension
>       -               ifNotNil: [extension valueOfProperty: aSymbol ifAbsent: aBlock]
>       -               ifNil: [aBlock value]!
>
>       Item was changed:
>         ----- Method: MorphExtension>>layoutFrame (in category 'accessing - layout properties') -----
>         layoutFrame
>       +       ^self valueOfProperty: #layoutFrame!
>       -       ^self valueOfProperty: #layoutFrame ifAbsent:[nil]!
>
>       Item was changed:
>         ----- Method: MorphExtension>>layoutPolicy (in category 'accessing - layout properties') -----
>         layoutPolicy
>       +       ^self valueOfProperty: #layoutPolicy!
>       -       ^self valueOfProperty: #layoutPolicy ifAbsent:[nil]!
>
>       Item was changed:
>         ----- Method: MorphExtension>>layoutProperties (in category 'accessing - layout properties') -----
>         layoutProperties
>       +       ^self valueOfProperty: #layoutProperties!
>       -       ^self valueOfProperty: #layoutProperties ifAbsent:[nil]!
>
>       Item was changed:
>         ----- Method: MorphExtension>>valueOfProperty: (in category 'accessing - other properties') -----
>         valueOfProperty: aSymbol
>         "answer the value of the receiver's property named aSymbol"
>       +
>       +       ^otherProperties ifNotNil: [ otherProperties at: aSymbol ifAbsent: nil ]!
>       -       ^ self
>       -               valueOfProperty: aSymbol
>       -               ifAbsent: []!
>
>       Item was changed:
>         ----- Method: MorphExtension>>valueOfProperty:ifAbsent: (in category 'accessing - other properties') -----
>         valueOfProperty: aSymbol ifAbsent: aBlock
>               "if the receiver possesses a property of the given name, answer
>               its value. If not then evaluate aBlock and answer the result of
>               this block evaluation"
>               otherProperties ifNil: [^ aBlock value].
>       +       ^otherProperties at: aSymbol ifAbsent: aBlock!
>       -       ^ otherProperties at: aSymbol ifAbsent: [^ aBlock value]!
> 
> 
> 
> 
>


More information about the Squeak-dev mailing list