Jump to page: 1 2 3
Thread overview
Atila Neves: "C IS NOT MAGICALLY FAST, PART 2"
Jul 19, 2016
Saurabh Das
Jul 19, 2016
deadalnix
Jul 19, 2016
Meta
Jul 19, 2016
Craig Dillabaugh
Jul 19, 2016
Atila Neves
Jul 19, 2016
Jakob Bornecrantz
Jul 19, 2016
Atila Neves
Jul 19, 2016
bigsandwich
Jul 19, 2016
Sönke Ludwig
Jul 19, 2016
Kagamin
Jul 19, 2016
Jack Stouffer
Jul 19, 2016
Atila Neves
Jul 19, 2016
Johan Engelen
Jul 19, 2016
Atila Neves
Jul 19, 2016
Lodovico Giaretta
Jul 19, 2016
Atila Neves
Jul 19, 2016
Jakob Bornecrantz
Jul 19, 2016
deadalnix
Jul 19, 2016
Ali Çehreli
Jul 19, 2016
Ali Çehreli
July 19, 2016
Posted on Atila's blog yesterday:

https://atilanevesoncode.wordpress.com/2016/07/18/c-is-not-magically-fast-part-2/


July 19, 2016
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/

Where is the part one ?
July 19, 2016
On Tuesday, 19 July 2016 at 03:03:38 UTC, deadalnix wrote:
> 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/
>
> Where is the part one ?

https://atilanevesoncode.wordpress.com/2015/08/24/c-is-not-magically-fast/
July 19, 2016
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
July 19, 2016
On Tuesday, 19 July 2016 at 10:07:11 UTC, Atila Neves wrote:
> 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

What is the sizeof(Foo) for all of the cases?

What does "charPtr < charPtr" do in C++ compared to std::string?

Cheers, Jakob.
July 19, 2016
On Tuesday, 19 July 2016 at 03:03:38 UTC, deadalnix wrote:
> 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/
>
> Where is the part one ?

https://atilanevesoncode.wordpress.com/2015/08/24/c-is-not-magically-fast/
July 19, 2016
On Tuesday, 19 July 2016 at 10:07:11 UTC, Atila Neves wrote:
> 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

C++ Swap may be specialized for POD.
July 19, 2016
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.
July 19, 2016
On Tuesday, 19 July 2016 at 14:39:54 UTC, Sönke Ludwig wrote:
> One thing that the D version does and the others don't is comparing UTF code points instead of bytes.

Are you sure? Autodecoding is a phobos feature, but here druntime is used for string comparison, and it usually doesn't provide autodecoding.
July 19, 2016
On Tuesday, 19 July 2016 at 15:05:30 UTC, Kagamin wrote:
> On Tuesday, 19 July 2016 at 14:39:54 UTC, Sönke Ludwig wrote:
>> One thing that the D version does and the others don't is comparing UTF code points instead of bytes.
>
> Are you sure? Autodecoding is a phobos feature, but here druntime is used for string comparison, and it usually doesn't provide autodecoding.

Yeah, auto-decoding isn't at play here.
« First   ‹ Prev
1 2 3