[Vm-dev] String comparison primitive preliminary speed-up result: 20-600x

Clément Bera bera.clement at gmail.com
Wed Feb 21 14:19:53 UTC 2018


And now on Mac (LLVM),

I get for string of size 3 (Misc primitive, Slang primitive, Slang + JIT
primitive):

#('15,700,000 per second. 63.8 nanoseconds per run.'
'41,600,000 per second. 24 nanoseconds per run.'
'78,600,000 per second. 12.7 nanoseconds per run.')

for a string of size 1000:

#('841,000 per second. 1.19 microseconds per run.'
'1,500,000 per second. 666 nanoseconds per run.'
'2,190,000 per second. 457 nanoseconds per run.')

which is much closer to what I expected in the first place. The results we
got really surprised me but I could not figure out what was wrong.

I will update the post.

Thanks Henrik.

On Wed, Feb 21, 2018 at 3:13 PM, Clément Bera <bera.clement at gmail.com>
wrote:

> Right I knew something was off.
>
> Let me patch this.
>
> On Wed, Feb 21, 2018 at 3:00 PM, Henrik Sperre Johansen <
> henrik.s.johansen at veloxit.no> wrote:
>
>>
>> Ref. blog post, are you sure you are measuring equivalent entities?
>> Usually the AsciiOrder is a constant, preallocated array, no?
>>
>> Seems to me, with the code posted in blog post, you're mostly measuring
>> array instantation, not collate...
>>
>> var := ByteString new: 3.
>>
>>  [ByteString compare: var with: var collated: (0 to: 255) asByteArray]
>> benchFor: 5 second.
>> a BenchmarkResult(500,460 iterations in 5 seconds 1 millisecond. 100,072
>> per
>> second)
>>
>> AsciiCollate := (0 to: 255) asByteArray.
>>
>>  [ByteString compare: var with: var collated: AsciiCollate] benchFor: 5
>> second.
>>
>> a BenchmarkResult(79,507,782 iterations in 5 seconds 2 milliseconds.
>> 15,895,198 per second)
>>
>>
>>
>> --
>> Sent from: http://forum.world.st/Squeak-VM-f104410.html
>>
>
>
>
> --
> Clément Béra
> Pharo consortium engineer
> https://clementbera.wordpress.com/
> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
>



-- 
Clément Béra
Pharo consortium engineer
https://clementbera.wordpress.com/
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180221/b1740116/attachment.html>


More information about the Vm-dev mailing list