The Trunk: Morphic-ul.744.mcz

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

The Trunk: Morphic-ul.744.mcz

commits-2
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]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-ul.744.mcz

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

2014-09-26 17:11 GMT+02:00 <[hidden email]>:
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]!





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-ul.744.mcz

Eliot Miranda-2


On Fri, Sep 26, 2014 at 9:34 AM, Nicolas Cellier <[hidden email]> wrote:
So you rely on (nil value -> nil).
Will (is) the difference be still significant in Spur?

Spur won't change that.  Spur shouldn't change visible semantics at all beyond v asCharacter == v asCharacter is always true.


2014-09-26 17:11 GMT+02:00 <[hidden email]>:

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]!









--
best,
Eliot


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-ul.744.mcz

Levente Uzonyi-2
In reply to this post by Nicolas Cellier
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 <[hidden email]>:
>       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]!
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-ul.744.mcz

Nicolas Cellier
In reply to this post by Eliot Miranda-2
2014-09-26 19:56 UTC+02:00, Eliot Miranda <[hidden email]>:

> On Fri, Sep 26, 2014 at 9:34 AM, Nicolas Cellier <
> [hidden email]> wrote:
>
>> So you rely on (nil value -> nil).
>> Will (is) the difference be still significant in Spur?
>>
>
> Spur won't change that.  Spur shouldn't change visible semantics at all
> beyond v asCharacter == v asCharacter is always true.
>

I mean will (does) Spur changes the timing ratio of [] value over nil value?

>
>> 2014-09-26 17:11 GMT+02:00 <[hidden email]>:
>>
>> 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]!
>>>
>>>
>>>
>>
>>
>>
>>
>
>
> --
> best,
> Eliot
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-ul.744.mcz

Eliot Miranda-2


On Fri, Sep 26, 2014 at 1:53 PM, Nicolas Cellier <[hidden email]> wrote:
2014-09-26 19:56 UTC+02:00, Eliot Miranda <[hidden email]>:
> On Fri, Sep 26, 2014 at 9:34 AM, Nicolas Cellier <
> [hidden email]> wrote:
>
>> So you rely on (nil value -> nil).
>> Will (is) the difference be still significant in Spur?
>>
>
> Spur won't change that.  Spur shouldn't change visible semantics at all
> beyond v asCharacter == v asCharacter is always true.
>

I mean will (does) Spur changes the timing ratio of [] value over nil value?

Ah, no.  Block dispatch is essentially unchanged.
 

>
>> 2014-09-26 17:11 GMT+02:00 <[hidden email]>:
>>
>> 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]!
>>>
>>>
>>>
>>
>>
>>
>>
>
>
> --
> best,
> Eliot
>




--
best,
Eliot