Atila Neves: "C IS NOT MAGICALLY FAST, PART 2"

Atila Neves via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 19 08:46:34 PDT 2016


On Tuesday, 19 July 2016 at 14:39:54 UTC, Sönke Ludwig wrote:
> Am 19.07.2016 um 12:07 schrieb Atila Neves:
>> On Tuesday, 19 July 2016 at 02:54:37 UTC, Saurabh Das wrote:
>>>
>>> Posted on Atila's blog yesterday:
>>>
>>> https://atilanevesoncode.wordpress.com/2016/07/18/c-is-not-magically-fast-part-2/
>>>
>>
>> So, about D vs C++ there... last night for reasons I forget I 
>> tried
>> replacing std::string with const char* in the C++ version, and 
>> then it
>> got faster than D. I don't know why.
>>
>> At first I thought std::string was being copied instead of 
>> being moved,
>> but some static_asserts made me doubt that. Either way, 
>> there's no good
>> reason I can think of for C++ to magically speed up for const 
>> char*. Hmm :(
>>
>> Atila
>
> One thing that the D version does and the others don't is 
> comparing UTF code points instead of bytes.

I considered that too so I cast them to ubyte[]. No difference.


More information about the Digitalmars-d mailing list