November 12, 2013
On 11/12/13, Sergei Nosov <sergei.nosov@gmail.com> wrote:
> In my version of dub it's "-release -inline -O". I've tried also adding the -noboundscheck flag and it yielded the same results. I guess the setup for ldc is similar.

What about using -version=CHIP_USE_DOUBLES ? I get quite a slowdown when using it with DMD, I'm wondering whether it's compiler-specific.
November 12, 2013
On Tuesday, 12 November 2013 at 04:07:14 UTC, Andrej Mitrovic wrote:
> On 11/12/13, Sergei Nosov <sergei.nosov@gmail.com> wrote:
>> In my version of dub it's "-release -inline -O". I've tried also
>> adding the -noboundscheck flag and it yielded the same results. I
>> guess the setup for ldc is similar.
>
> What about using -version=CHIP_USE_DOUBLES ? I get quite a slowdown
> when using it with DMD, I'm wondering whether it's compiler-specific.

For some reason, DMD (v2.064.2) fails to compile with that flag. The error is:
Internal error: ../ztc/cg87.c 331
Error: DMD compile run failed with exit code 1

LDC slows down for about 20-25%. Timings:
5797.39
2779.01
537.136
13459.3
4483.73
865.685
9324.52
4311.65
809.551
1088.42
1705.75
1701.38
6041.41
11310.5
409.587
726.283
10.6212
November 12, 2013
On 11/12/13, Sergei Nosov <sergei.nosov@gmail.com> wrote:
> For some reason, DMD (v2.064.2) fails to compile with that flag.
> The error is:
> Internal error: ../ztc/cg87.c 331
> Error: DMD compile run failed with exit code 1

Aww. If only dub knew how to automatically run dustmite.

> LDC slows down for about 20-25%.

Interesting. Thanks.

Btw, how did you make dub use a -version flag anyway? I can't figure it out from the docs. I suppose it's something like:

dub --build=release --version=?

But I see that --version means something else in dub.
November 12, 2013
On Tuesday, 12 November 2013 at 15:39:27 UTC, Andrej Mitrovic wrote:
> Btw, how did you make dub use a -version flag anyway? I can't figure
> it out from the docs. I suppose it's something like:
>
> dub --build=release --version=?
>
> But I see that --version means something else in dub.

It is done via package.json modification, for whole project or some specific configurations : code.dlang.org/package-format

Also: "Note that setting the DFLAGS environment variable will override the build type with custom flags." (c) dub
November 12, 2013
Am 12.11.2013 16:39, schrieb Andrej Mitrovic:
> Btw, how did you make dub use a -version flag anyway? I can't figure it out from the docs. I suppose it's something like:
> 
> dub --build=release --version=?
> 
> But I see that --version means something else in dub.
> 

If it's just temporary, this should work:

	DFLAGS=-version=X dub --build=release

But for regular version flags that should be accessible to high level packages in a prominent way, the best way is to define two separate configurations and use the "versions" field:

	{
		...
		"configurations" {
			{
				"name": "single",
			},
			{
				"name": "double",
				"versions": ["CHIP_USE_DOUBLES"]
			}
		}
	}

And then build with

	dub --build=release --config=double
November 12, 2013
Am 12.11.2013 16:55, schrieb Dicebot:
> On Tuesday, 12 November 2013 at 15:39:27 UTC, Andrej Mitrovic wrote:
>> Btw, how did you make dub use a -version flag anyway? I can't figure it out from the docs. I suppose it's something like:
>>
>> dub --build=release --version=?
>>
>> But I see that --version means something else in dub.
> 
> It is done via package.json modification, for whole project or some specific configurations : code.dlang.org/package-format
> 
> Also: "Note that setting the DFLAGS environment variable will override the build type with custom flags." (c) dub

Beat me to it... again ;)

Correction of my previous reply:

	DFLAGS="-release -O -inline -version=CHIP_USE_DOUBLES" dub
1 2 3
Next ›   Last »