July 31, 2013
On 7/30/2013 11:40 PM, dennis luehring wrote:
> currently the vc builded dmd is about 2 times faster in compiling

That's an old number now. Someone want to try it with the current HEAD?

July 31, 2013
Am 31.07.2013 09:00, schrieb Walter Bright:
> On 7/30/2013 11:40 PM, dennis luehring wrote:
>> currently the vc builded dmd is about 2 times faster in compiling
>
> That's an old number now. Someone want to try it with the current HEAD?
>

tried to but failed

downloaded dmd-master.zip (from github)
downloaded dmd.2.063.2.zip

buidl dmd-master with vs2010
copied the produces dmd_msc.exe to dmd.2.063.2\dmd2\windows\bin

dmd.2.063.2\dmd2\src\phobos>..\..\windows\bin\dmd.exe std\algorithm -unittest -main

gives

Error: cannot read file ûmain.d (what is this "û" in front of main.d?)

dmd.2.063.2\dmd2\src\phobos>..\..\windows\bin\dmd_msc.exe std\algorithm -unittest -main

gives

std\datetime.d(31979): Error: pure function 'std.datetime.enforceValid!"hours".enforceValid' cannot call impure function 'core.time.TimeException.this'
std\datetime.d(13556): Error: template instance std.datetime.enforceValid!"hours" error instantiating
std\datetime.d(31984): Error: pure function 'std.datetime.enforceValid!"minutes".enforceValid' cannot call impure function 'core.time.TimeException.this'
std\datetime.d(13557): Error: template instance std.datetime.enforceValid!"minutes" error instantiating
std\datetime.d(31989): Error: pure function 'std.datetime.enforceValid!"seconds".enforceValid' cannot call impure function 'core.time.TimeException.this'
std\datetime.d(13558): Error: template instance std.datetime.enforceValid!"seconds" error instantiating
std\datetime.d(33284):        called from here: (TimeOfDay __ctmp1990;
 , __ctmp1990).this(0, 0, 0)
std\datetime.d(33293): Error: CTFE failed because of previous errors in this
std\datetime.d(31974): Error: pure function 'std.datetime.enforceValid!"months".enforceValid' cannot call impure function 'core.time.TimeException.this'
std\datetime.d(8994): Error: template instance std.datetime.enforceValid!"months" error instantiating
std\datetime.d(32012): Error: pure function 'std.datetime.enforceValid!"days".enforceValid' cannot call impure function 'core.time.TimeException.this'
std\datetime.d(8995): Error: template instance std.datetime.enforceValid!"days" error instantiating
std\datetime.d(33389):        called from here: (Date __ctmp1999;
 , __ctmp1999).this(-3760, 9, 7)
std\datetime.d(33458): Error: CTFE failed because of previous errors in this
Error: undefined identifier '_xopCmp'

and a compiler crash


my former benchmark where done the same way and it worked without any problems - this master seems to have problems




July 31, 2013

On 31.07.2013 09:00, Walter Bright wrote:
> On 7/30/2013 11:40 PM, dennis luehring wrote:
>> currently the vc builded dmd is about 2 times faster in compiling
>
> That's an old number now. Someone want to try it with the current HEAD?
>

I have just tried yesterdays dmd to build Visual D (it builds some libraries and contains a few short non-compiling tasks in between):

Debug build dmd_dmc: 23 sec, std new 43 sec
Debug build dmd_msc: 19 sec, std new 20 sec

"std new" is the version without the "block allocator".

Release build dmd_dmc: 3 min 30, std new 5 min 25
Release build dmd_msc: 1 min 32, std new 1 min 40

The release builds use "-release -O -inline" and need a bit more than 1 GB memory for two of the libraries (I still had to patch dmd_dmc to be large-address-aware).

This shows that removing most of the allocations was a good optimization for the dmc-Runtime, but does not have a large, but still notable impact on a faster heap implementation (the VS runtime usually maps directly to the Windows API for non-Debug builds). I suspect the backend and the optimizer do not use "new" a lot, but plain "malloc" calls, so they still suffer from the slow runtime.
July 31, 2013
Thanks for doing this, this is good information.

On 7/31/2013 2:24 PM, Rainer Schuetze wrote:
> I have just tried yesterdays dmd to build Visual D (it builds some libraries and
> contains a few short non-compiling tasks in between):
>
> Debug build dmd_dmc: 23 sec, std new 43 sec
> Debug build dmd_msc: 19 sec, std new 20 sec

That makes it clear that the dmc malloc() was the dominator, not code gen.

> "std new" is the version without the "block allocator".
>
> Release build dmd_dmc: 3 min 30, std new 5 min 25
> Release build dmd_msc: 1 min 32, std new 1 min 40
>
> The release builds use "-release -O -inline" and need a bit more than 1 GB
> memory for two of the libraries (I still had to patch dmd_dmc to be
> large-address-aware).
>
> This shows that removing most of the allocations was a good optimization for the
> dmc-Runtime, but does not have a large, but still notable impact on a faster
> heap implementation (the VS runtime usually maps directly to the Windows API for
> non-Debug builds). I suspect the backend and the optimizer do not use "new" a
> lot, but plain "malloc" calls, so they still suffer from the slow runtime.

Actually, dmc still should give a better showing. All the optimizations I've put into dmd also went into dmc, and do result in significantly better code speed. For example, the hash modulus optimization has a significant impact, but I haven't released that dmc yet.

Optimized builds have an entirely different profile than debug builds, and I haven't investigated that.

August 01, 2013
Am 31.07.2013 23:24, schrieb Rainer Schuetze:
>
>
> On 31.07.2013 09:00, Walter Bright wrote:
>> On 7/30/2013 11:40 PM, dennis luehring wrote:
>>> currently the vc builded dmd is about 2 times faster in compiling
>>
>> That's an old number now. Someone want to try it with the current HEAD?
>>
>
> I have just tried yesterdays dmd to build Visual D (it builds some
> libraries and contains a few short non-compiling tasks in between):

can you also give us also timings for

(dmd_dmc|dmd_msc) std\algorithm -unittest -main


August 01, 2013

On 01.08.2013 07:33, dennis luehring wrote:
> Am 31.07.2013 23:24, schrieb Rainer Schuetze:
>>
>>
>> On 31.07.2013 09:00, Walter Bright wrote:
>>> On 7/30/2013 11:40 PM, dennis luehring wrote:
>>>> currently the vc builded dmd is about 2 times faster in compiling
>>>
>>> That's an old number now. Someone want to try it with the current HEAD?
>>>
>>
>> I have just tried yesterdays dmd to build Visual D (it builds some
>> libraries and contains a few short non-compiling tasks in between):
>
> can you also give us also timings for
>
> (dmd_dmc|dmd_msc) std\algorithm -unittest -main
>
>

std.algorithm -unittest -main:

dmd_dmc 20 sec, std new 61 sec
dmd_msc 11 sec, std new 13 sec

std.algorithm -unittest -main -O:

dmd_dmc 27 sec, std new 68 sec
dmd_msc 16 sec, std new 18 sec
August 01, 2013
Am 01.08.2013 08:16, schrieb Rainer Schuetze:
>
>
> On 01.08.2013 07:33, dennis luehring wrote:
>> Am 31.07.2013 23:24, schrieb Rainer Schuetze:
>>>
>>>
>>> On 31.07.2013 09:00, Walter Bright wrote:
>>>> On 7/30/2013 11:40 PM, dennis luehring wrote:
>>>>> currently the vc builded dmd is about 2 times faster in compiling
>>>>
>>>> That's an old number now. Someone want to try it with the current HEAD?
>>>>
>>>
>>> I have just tried yesterdays dmd to build Visual D (it builds some
>>> libraries and contains a few short non-compiling tasks in between):
>>
>> can you also give us also timings for
>>
>> (dmd_dmc|dmd_msc) std\algorithm -unittest -main
>>
>>
>
> std.algorithm -unittest -main:
>
> dmd_dmc 20 sec, std new 61 sec
> dmd_msc 11 sec, std new 13 sec
>
> std.algorithm -unittest -main -O:
>
> dmd_dmc 27 sec, std new 68 sec
> dmd_msc 16 sec, std new 18 sec
>

so we can "still" say das msc builds are around two times faster - or even faster
August 01, 2013
Am 01.08.2013 08:16, schrieb Rainer Schuetze:
>
>
> On 01.08.2013 07:33, dennis luehring wrote:
>> Am 31.07.2013 23:24, schrieb Rainer Schuetze:
>>>
>>>
>>> On 31.07.2013 09:00, Walter Bright wrote:
>>>> On 7/30/2013 11:40 PM, dennis luehring wrote:
>>>>> currently the vc builded dmd is about 2 times faster in compiling
>>>>
>>>> That's an old number now. Someone want to try it with the current HEAD?
>>>>
>>>
>>> I have just tried yesterdays dmd to build Visual D (it builds some
>>> libraries and contains a few short non-compiling tasks in between):
>>
>> can you also give us also timings for
>>
>> (dmd_dmc|dmd_msc) std\algorithm -unittest -main
>>
>>
>
> std.algorithm -unittest -main:
>
> dmd_dmc 20 sec, std new 61 sec
> dmd_msc 11 sec, std new 13 sec
>
> std.algorithm -unittest -main -O:
>
> dmd_dmc 27 sec, std new 68 sec
> dmd_msc 16 sec, std new 18 sec
>

results from mingw, vs2012(13) and llvm-clang builds would be also very interesting, but i don't know if dmd can be build with mingw or clang out of the box under windows
August 01, 2013
I've now upgraded dmc so dmd builds can take advantage of improved code generation.

http://www.digitalmars.com/download/freecompiler.html
August 02, 2013

On 02.08.2013 00:36, Walter Bright wrote:
> I've now upgraded dmc so dmd builds can take advantage of improved code
> generation.
>
> http://www.digitalmars.com/download/freecompiler.html

Although my laptop got quite a bit faster overnight (I guess it was throttled for some reason yesterday), relative results don't change:

std.algorithm -main -unittest

dmc85?: 12.5 sec
dmc857: 12.5 sec
msc: 7 sec

BTW: I usually use VS2008, but now also tried VS2010 - no difference.