Re: Performance issue in struct initialization

2016-06-20 Thread Johannes Pfau via Digitalmars-d
Am Mon, 20 Jun 2016 20:34:12 + schrieb Basile B. : > On Monday, 20 June 2016 at 11:45:28 UTC, Johannes Pfau wrote: > > Am Sun, 19 Jun 2016 20:52:52 + > > schrieb deadalnix : > > > >> On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: > >> >

Re: Performance issue in struct initialization

2016-06-20 Thread Basile B. via Digitalmars-d
On Monday, 20 June 2016 at 11:45:28 UTC, Johannes Pfau wrote: Am Sun, 19 Jun 2016 20:52:52 + schrieb deadalnix : On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: > On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei > Alexandrescu wrote: >>

Re: Performance issue in struct initialization

2016-06-20 Thread Johannes Pfau via Digitalmars-d
Am Sun, 19 Jun 2016 20:52:52 + schrieb deadalnix : > On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: > > On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu > > wrote: > >> https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few > >>

Re: Performance issue in struct initialization

2016-06-20 Thread Johannes Pfau via Digitalmars-d
Am Sat, 28 May 2016 07:08:52 + schrieb Era Scarecrow : > On Friday, 27 May 2016 at 09:02:17 UTC, Johan Engelen wrote: > > That language guarantee prevents optimization of the > > initialization (in this case, the optimized result would be no > > initialization at all). So

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Sunday, 19 June 2016 at 20:52:52 UTC, deadalnix wrote: On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Sunday, 19 June 2016 at 20:52:52 UTC, deadalnix wrote: On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in

Re: Performance issue in struct initialization

2016-06-19 Thread deadalnix via Digitalmars-d
On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei A new "@noinit"

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei A new "@noinit"

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei A new "@noinit" attribute could solve this issue and other cases where the

Re: Performance issue in struct initialization

2016-05-28 Thread Era Scarecrow via Digitalmars-d
On Friday, 27 May 2016 at 09:02:17 UTC, Johan Engelen wrote: That language guarantee prevents optimization of the initialization (in this case, the optimized result would be no initialization at all). So a breaking language spec change would be needed. Is this pursued by anyone? Perhaps only

Re: Performance issue in struct initialization

2016-05-27 Thread Johan Engelen via Digitalmars-d
https://issues.dlang.org/show_bug.cgi?id=15951 https://issues.dlang.org/show_bug.cgi?id=11817 https://issues.dlang.org/show_bug.cgi?id=11331 What I gather from the discussions is that the current spec says that: ``` struct S { char[100] arr = void; } S a; S b; assert(a == b); ``` That

Re: Performance issue in struct initialization

2016-04-23 Thread Basile B via Digitalmars-d
On Saturday, 23 April 2016 at 14:10:06 UTC, Basile B wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei In the first

Re: Performance issue in struct initialization

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
On 4/23/16 10:10 AM, Basile B wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei In the first example you've forget to

Re: Performance issue in struct initialization

2016-04-23 Thread Basile B via Digitalmars-d
On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei In the first example you've forget to assign void:

Re: Performance issue in struct initialization

2016-04-23 Thread rikki cattermole via Digitalmars-d
On 24/04/2016 1:37 AM, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei That opEquals that is generated looks awfully big as well. Also form what I've read you could get a

Performance issue in struct initialization

2016-04-23 Thread Andrei Alexandrescu via Digitalmars-d
https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei