Port a benchmark to D?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jun 3 13:47:27 PDT 2011


On 6/3/11 3:01 PM, Timon Gehr wrote:
> Andrei Alexandresco wrote:
>> On 6/3/11 2:48 PM, Timon Gehr wrote:
>>> bearophile wrote:
>>>> Timon Gehr:
>>>>
>>>>> OK. I'll start right away.
>>>>
>>>> I have independently started it too :-)
>>>> But this article written by Google and its benchmarking methodology are not good.
>>>>
>>>> Bye,
>>>> bearophile
>>>
>>> Ok, we can compare the two implementations afterwards. BTW, have you already
>>> noticed how incredibly stupid some parts of the implementation of cpp are?
>>>
>>> I think I will also do a d_pro version after porting cpp.
>>>
>>> Timon
>>
>> One note - some of their std::list uses can be replaced by SList, and
>> others by built-in arrays.
>>
>> Andrei
>
> Yes, but built-in arrays are more similar to std::vector, therefore it might
> already be an optimization over the original benchmark. I'm not sure if that is okay?
>
> Timon

I noticed that the C++ code uses std::list without there being any need 
for a linked list structure. See for example the data structure used in 
FindSet. It's a list, but it's just appended too and then used for one 
iteration.

Andrei


More information about the Digitalmars-d mailing list