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

2016-07-19 Thread Jakob Bornecrantz via Digitalmars-d
On Tuesday, 19 July 2016 at 16:13:21 UTC, Atila Neves wrote: On Tuesday, 19 July 2016 at 16:01:01 UTC, Lodovico Giaretta wrote: On Tuesday, 19 July 2016 at 15:48:26 UTC, Atila Neves wrote: Small string optimization should _help_ std::string, no? Atila Small string optimization will make the

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

2016-07-19 Thread Ali Çehreli via Digitalmars-d
On 07/19/2016 12:00 PM, Ali Çehreli wrote: > On 07/19/2016 10:41 AM, deadalnix wrote: >> if(i < other.i) return -1; >> if(i > other.i) return 1; >> >> Should be >> >> (i > other.i) - (i < other.i) >> >> Surprisingly, LLVM was unable to optimize one into the other in my tests. If you mean the

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

2016-07-19 Thread Ali Çehreli via Digitalmars-d
On 07/19/2016 10:41 AM, deadalnix wrote: 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

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

2016-07-19 Thread deadalnix via Digitalmars-d
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

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

2016-07-19 Thread Steven Schveighoffer via Digitalmars-d
On 7/19/16 11:48 AM, Atila Neves wrote: On Tuesday, 19 July 2016 at 15:28:45 UTC, Johan Engelen wrote: On Tuesday, 19 July 2016 at 10:07:11 UTC, Atila Neves wrote: [...] Very interested to hear why one is faster than the other. [...] The strings seem a little short, e.g. "foo1234foo" if

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

2016-07-19 Thread Atila Neves via Digitalmars-d
On Tuesday, 19 July 2016 at 16:01:01 UTC, Lodovico Giaretta wrote: On Tuesday, 19 July 2016 at 15:48:26 UTC, Atila Neves wrote: Small string optimization should _help_ std::string, no? Atila Small string optimization will make the struct bigger, thus making swapping slower. If the struct is

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

2016-07-19 Thread Lodovico Giaretta via Digitalmars-d
On Tuesday, 19 July 2016 at 15:48:26 UTC, Atila Neves wrote: Small string optimization should _help_ std::string, no? Atila Small string optimization will make the struct bigger, thus making swapping slower. If the struct is no bigger than 2 pointers, swapping it is ultra fast.

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

2016-07-19 Thread Atila Neves via Digitalmars-d
On Tuesday, 19 July 2016 at 15:28:45 UTC, Johan Engelen wrote: On Tuesday, 19 July 2016 at 10:07:11 UTC, Atila Neves wrote: [...] Very interested to hear why one is faster than the other. [...] The strings seem a little short, e.g. "foo1234foo" if I understand correctly. Could there be a

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

2016-07-19 Thread Atila Neves via Digitalmars-d
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,

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

2016-07-19 Thread Atila Neves via Digitalmars-d
On Tuesday, 19 July 2016 at 10:39:26 UTC, Jakob Bornecrantz wrote: 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:

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

2016-07-19 Thread Andrei Alexandrescu via Digitalmars-d
On 07/18/2016 10:54 PM, Saurabh Das wrote: Posted on Atila's blog yesterday: https://atilanevesoncode.wordpress.com/2016/07/18/c-is-not-magically-fast-part-2/ https://www.reddit.com/r/programming/comments/4tlqyc/c_is_not_magically_fast_twopart_article/ Andrei

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

2016-07-19 Thread Johan Engelen via Digitalmars-d
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

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

2016-07-19 Thread Jack Stouffer via Digitalmars-d
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

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

2016-07-19 Thread Kagamin via Digitalmars-d
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

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

2016-07-19 Thread Sönke Ludwig via Digitalmars-d
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

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

2016-07-19 Thread bigsandwich via Digitalmars-d
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

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

2016-07-19 Thread Craig Dillabaugh via Digitalmars-d
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 ?

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

2016-07-19 Thread Jakob Bornecrantz via Digitalmars-d
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

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

2016-07-19 Thread Atila Neves via Digitalmars-d
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

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

2016-07-18 Thread Meta via Digitalmars-d
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 ?

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

2016-07-18 Thread deadalnix via Digitalmars-d
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 ?

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

2016-07-18 Thread Saurabh Das via Digitalmars-d
Posted on Atila's blog yesterday: https://atilanevesoncode.wordpress.com/2016/07/18/c-is-not-magically-fast-part-2/