Study: build times for D programs

Iain Buclaw ibuclaw at ubuntu.com
Fri Jul 27 05:07:30 PDT 2012


On 27 July 2012 09:09, Joseph Rushton Wakeling
<joseph.wakeling at webdrake.net> wrote:
> On 27/07/12 07:29, Iain Buclaw wrote:
>>
>> -inline is mapped to -finline-functions in GDC.  Inlining is possibly
>> done, but only in the backend.
>>
>> Some extra notes to bear in mind about GDC.
>> 1) All methods and function literals are marked as 'inline' by default.
>> 2) Cross module inlining does not occur if you are compiling
>> one-at-a-time.
>
>
> Good to know.  In this case it's all compiled together in one go:
>
> ###############################################
> DC = gdmd
> DFLAGS = -O -release -inline
> DREGSRC = dregs/core.d dregs/codetermine.d
>
> all: test
>
> test: test.d $(DREGSRC)
>       $(DC) $(DFLAGS) -of$@ $^
>
> .PHONY: clean
>
> clean:
>       rm -f test *.o
> ###############################################
>
> I'm just surprised that using -inline produces no measurable difference at
> all in performance for GDC, whether or not any other optimization flags are
> used. As I said, maybe I'll test some manual inlining and see what
> difference it might make ...

My best assumption would be it may say something more about the way
the program was written itself rather than the compiler.


Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list