[Glass] Particular code that is much slower than Pharo
Mariano Martinez Peck via Glass
glass at lists.gemtalksystems.com
Tue Jan 24 12:45:20 PST 2017
On Tue, Jan 24, 2017 at 5:43 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:
>
>
> On Tue, Jan 24, 2017 at 5:28 PM, Dale Henrichs via Glass <
> glass at lists.gemtalksystems.com> wrote:
>
>> I ran this test using GemStone 3.4.0 and Pharo6.0 on the same hardware
>> and came out as only 2x slower: 79ms (G/S) vs 36ms (pharo) .... Allen (our
>> vm guy) thought that 3.3 might be a bit faster than 3.2 and sure enough, a
>> run on 3.2 came up with 111ms (3x slower). No code gen changes have been
>> made in 3.4.0 so the timings are similar.
>>
>>
> mmmm I am getting between 22ms and 24ms in Pharo, and around 85 on
> GemStone 3.2.9.
>
>
>> GemStone is going to be doing a bit more work for #at: than Pharo, since
>> we have to worry about faulting in objects and that costs a bit more ...
>>
>
> mmmm but in this case the contents of the Array are not persistent objects
> (not even objects as they are smallintegers)
>
> Isn't there a particular Array subclass with an override of #at: which
> uses a different primitive that does not takes care of faulting objects (it
> assumes the objects are not persistent)?
>
Actually...any Collection subclass would help...
>
>
>> I plan look at a few other things when I get a chance ...
>>
>
> Thanks! My process is taking hours on GemStone :(
>
>
> Thanks for your answer.
>
>
>> Dale
>> On 01/24/2017 11:42 AM, Mariano Martinez Peck via Glass wrote:
>>
>> | array1 another |
>> array1 := #( 1 2 3 4 5 6 7 8 9).
>> another := #(8 9 10 11 12 115 9 116 117 16 118).
>> 10000 timesRepeat: [
>> | answer i j selfSize anotherSize skipTestsTable |
>> answer := OrderedCollection new.
>> skipTestsTable := array1 collect: [ :each | Array new: another size ].
>> "all nils"
>>
>> selfSize := array1 size.
>> anotherSize := another size.
>> array1 doWithIndex: [:each :selfStart |
>> | skipTableAtStart |
>> skipTableAtStart := skipTestsTable at: selfStart.
>> 1 to: anotherSize do: [ :anotherStart|
>> (false or: [ (skipTableAtStart at: anotherStart) isNil]) ifTrue: [
>> each = (another at: anotherStart)
>> ifTrue: [
>> i := selfStart + 1.
>> j := anotherStart + 1.
>> [ (i <= selfSize and: [ j <= anotherSize ]) and: [ (array1 at: i) =
>> (another at: j)]]
>> whileTrue: [
>> (skipTestsTable at: i) at: j put: true.
>> i := i + 1.
>> j := j + 1. ].
>> answer add: { selfStart. anotherStart. (i - selfStart). i - 1 }
>> ] ]
>> ]
>> ].
>> answer asArray
>>
>> ]
>> ] timeToRun
>>
>>
>>
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
--
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20170124/4fc82d11/attachment-0001.html>
More information about the Glass
mailing list