bitShift: optimisation on COG [WAS: DigitalSignatureAlgorithm>>#initRandomNonInteractivelyisnot random]

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

bitShift: optimisation on COG [WAS: DigitalSignatureAlgorithm>>#initRandomNonInteractivelyisnot random]

Nicolas Cellier
2010/8/29 Nicolas Cellier <[hidden email]>:

> 2010/8/29 Levente Uzonyi <[hidden email]>:
>>
>> snip...
>>
>>> Maybe http://bugs.squeak.org/view.php?id=7109 would serve a bit too...
>>
>> Hm. This looks interresting, I guess some optimizations are already
>> implemented:
>>
>> | x |
>> x := SmallInteger maxVal raisedTo: 100.
>> #(-1600 -1597 1597 1600) collect: [ :shift |
>>        [ 1 to: 100000 do: [ :i | x bitShift: shift ] ] timeToRun ].
>> "CogVM  ===> #(150 147 271 64)"
>> "SquakVM ===> #(97 118 343 71)"
>>

I regenerated COG, and I get:

Original COG
        #(281 292 621 275)
        #(284 290 604 271)
COG + 7109
        #(167 239 509 289)
        #(172 246 500 288)
Oops, it was development build...

So I retried with deployment:
Original COG
        #(116 114 219 65)
        #(116 113 219 65)
COG + 7109
        #(47 77 120 61)
        #(46 75 120 61)

So I think yes, the patch should better be integrated.
It's only a small contributor of crypto timings, but it counts.

Nicolas

>>
>> Levente
>>
>
> I should have a look at source then...
>

Reply | Threaded
Open this post in threaded view
|

Re: bitShift: optimisation on COG [WAS: DigitalSignatureAlgorithm>>#initRandomNonInteractivelyisnot random]

Levente Uzonyi-2
On Sun, 29 Aug 2010, Nicolas Cellier wrote:

> 2010/8/29 Nicolas Cellier <[hidden email]>:
>> 2010/8/29 Levente Uzonyi <[hidden email]>:
>>>
>>> snip...
>>>
>>>> Maybe http://bugs.squeak.org/view.php?id=7109 would serve a bit too...
>>>
>>> Hm. This looks interresting, I guess some optimizations are already
>>> implemented:
>>>
>>> | x |
>>> x := SmallInteger maxVal raisedTo: 100.
>>> #(-1600 -1597 1597 1600) collect: [ :shift |
>>>        [ 1 to: 100000 do: [ :i | x bitShift: shift ] ] timeToRun ].
>>> "CogVM  ===> #(150 147 271 64)"
>>> "SquakVM ===> #(97 118 343 71)"
>>>
>
> I regenerated COG, and I get:
>
> Original COG
>        #(281 292 621 275)
>        #(284 290 604 271)
> COG + 7109
>        #(167 239 509 289)
>        #(172 246 500 288)
> Oops, it was development build...
>
> So I retried with deployment:
> Original COG
>        #(116 114 219 65)
>        #(116 113 219 65)
> COG + 7109
>        #(47 77 120 61)
>        #(46 75 120 61)
>
> So I think yes, the patch should better be integrated.
> It's only a small contributor of crypto timings, but it counts.
Cool. It's time to move this thread to the vm-dev list to get these
patches into the vm trunk.


Levente

>
> Nicolas
>
>>>
>>> Levente
>>>
>>
>> I should have a look at source then...
>>
>
>