On Saturday, 14 November 2015 at 00:37:51 UTC, Manu wrote:
In the meantime, there probably needs to be strong warnings
about violating attributes, and if patterns have emerged that
rely on violating such attributes, we should publish a
recommended alternative.
One pattern that comes to mind
On 11/12/2015 11:50 AM, Ali Çehreli wrote:
I would love to be convinced. :) Can someone come up with a reduced
example please?
On 11/12/2015 03:59 AM, Daniel Kozak wrote:
> for (i=0; i < 100; ++i) {
> fmttable(table);
> }
I think what we are seeing here is more due
On Thursday, 12 November 2015 at 21:24:30 UTC, David Nadlinger
wrote:
On Thursday, 12 November 2015 at 21:16:25 UTC, Walter Bright
wrote:
[...]
Oh, GCC has had similar notions as a non-standard attribute for
ages, and LLVM since its inception.
At least for LDC, the reason why we do not
On Friday, 13 November 2015 at 19:59:51 UTC, Ali Çehreli wrote:
On 11/12/2015 11:50 AM, Ali Çehreli wrote:
I would love to be convinced. :) Can someone come up with a
reduced
example please?
On 11/12/2015 03:59 AM, Daniel Kozak wrote:
> for (i=0; i < 100; ++i) {
>
On 13 November 2015 at 08:38, Iain Buclaw via Digitalmars-d
wrote:
> On 12 Nov 2015 10:25 pm, "David Nadlinger via Digitalmars-d"
> wrote:
>>
>> On Thursday, 12 November 2015 at 21:16:25 UTC, Walter Bright wrote:
>>>
>>> It's more than
I would love to be convinced. :) Can someone come up with a reduced
example please?
On 11/12/2015 03:59 AM, Daniel Kozak wrote:
> for (i=0; i < 100; ++i) {
> fmttable(table);
> }
I think what we are seeing here is more due to the unused side-effect in
the loop, where
On Thursday, 12 November 2015 at 19:11:25 UTC, tired_eyes wrote:
On Thursday, 12 November 2015 at 14:44:49 UTC, John Colvin
wrote:
To test the speed of fmttable itself I split fmttable and main
in to different modules, made fmttable extern(C) so I could
just prototype it in the main module
On Thursday, 12 November 2015 at 21:16:25 UTC, Walter Bright
wrote:
It's more than that - dmd's optimizer is designed to make use
of the guarantees of a pure function. Since C/C++ do not have
pure functions, ldc/gdc's optimizer may not have that
capability.
Oh, GCC has had similar notions as
On 11/12/2015 6:44 AM, John Colvin wrote:
dmd is being clever and spotting that fmttable is pure, it would be good if
ldc/gdc could spot this to.
It's more than that - dmd's optimizer is designed to make use of the guarantees
of a pure function. Since C/C++ do not have pure functions,
On Thursday, 12 November 2015 at 21:16:25 UTC, Walter Bright
wrote:
On 11/12/2015 6:44 AM, John Colvin wrote:
dmd is being clever and spotting that fmttable is pure, it
would be good if
ldc/gdc could spot this to.
It's more than that - dmd's optimizer is designed to make use
of the
On 12 Nov 2015 10:25 pm, "David Nadlinger via Digitalmars-d" <
digitalmars-d@puremagic.com> wrote:
>
> On Thursday, 12 November 2015 at 21:16:25 UTC, Walter Bright wrote:
>>
>> It's more than that - dmd's optimizer is designed to make use of the
guarantees of a pure function. Since C/C++ do not
On 12 November 2015 at 12:59, Daniel Kozak via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:
> code:
>
>
>
> GDC (-O3 -finline -frelease -fno-bounds-check):
> real0m0.724s
> user0m0.720s
> sys 0m0.003s
>
>
Not to be pedantic, but -finline does nothing (what you really want is
On Thursday, 12 November 2015 at 11:59:50 UTC, Daniel Kozak wrote:
code:
import std.stdio;
auto fmttable(immutable(string[][]) table) {
import std.array : appender, uninitializedArray;
import std.range : take, repeat;
import std.exception : assumeUnique;
auto res =
V Thu, 12 Nov 2015 13:37:28 +0100
Iain Buclaw via Digitalmars-d napsáno:
> On 12 November 2015 at 12:59, Daniel Kozak via Digitalmars-d <
> digitalmars-d@puremagic.com> wrote:
>
> > code:
> >
> >
>
>
>
> >
> > GDC (-O3 -finline -frelease -fno-bounds-check):
> >
code:
import std.stdio;
auto fmttable(immutable(string[][]) table) {
import std.array : appender, uninitializedArray;
import std.range : take, repeat;
import std.exception : assumeUnique;
auto res = appender(uninitializedArray!(char[])(128));
res.clear();
if
V Thu, 12 Nov 2015 12:10:30 +
John Colvin via Digitalmars-d napsáno:
> On Thursday, 12 November 2015 at 11:59:50 UTC, Daniel Kozak wrote:
> > code:
> >
> > import std.stdio;
> >
> > auto fmttable(immutable(string[][]) table) {
> >
> > import std.array :
On Thursday, 12 November 2015 at 12:23:11 UTC, Daniel Kozak wrote:
V Thu, 12 Nov 2015 12:10:30 +
John Colvin via Digitalmars-d
napsáno:
On Thursday, 12 November 2015 at 11:59:50 UTC, Daniel Kozak
wrote:
> [...]
What versions of these compilers? I suspect
On Thursday, 12 November 2015 at 11:59:50 UTC, Daniel Kozak wrote:
code:
import std.stdio;
auto fmttable(immutable(string[][]) table) {
import std.array : appender, uninitializedArray;
import std.range : take, repeat;
import std.exception : assumeUnique;
auto res =
V Thu, 12 Nov 2015 12:38:47 +
John Colvin via Digitalmars-d napsáno:
> On Thursday, 12 November 2015 at 12:23:11 UTC, Daniel Kozak wrote:
> > V Thu, 12 Nov 2015 12:10:30 +
> > John Colvin via Digitalmars-d
> > napsáno:
> >
>
On Thursday, 12 November 2015 at 14:44:49 UTC, John Colvin wrote:
To test the speed of fmttable itself I split fmttable and main
in to different modules, made fmttable extern(C) so I could
just prototype it in the main module (no import), then compiled
them separately before linking. This
On Thursday, 12 November 2015 at 14:44:49 UTC, John Colvin wrote:
dmd is being clever and spotting that fmttable is pure, it
would be good if ldc/gdc could spot this to.
I don't recall seeing anything in the 2.069.0 change log about
improved attribute inference for auto functions. If you
On 11/12/15 13:22, Daniel Kozak via Digitalmars-d wrote:
>>> timings:
>>> > >
>>> > > DMD (-O -release -inline -boundscheck=off):
>>> > > real0m0.003s
>>> > > user0m0.000s
>>> > > sys 0m0.000s
>>> > >
>>> > > LDMD2-ldc2 (-O -release -inline -boundscheck=off):
>>> > > real0m1.071s
22 matches
Mail list logo