Do everything in Java…

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 9 11:22:13 PST 2014


09-Dec-2014 22:18, Iain Buclaw via Digitalmars-d пишет:
> On 9 December 2014 at 19:15, H. S. Teoh via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>> On Tue, Dec 09, 2014 at 10:08:35PM +0300, Dmitry Olshansky via Digitalmars-d wrote:
>>> 09-Dec-2014 20:54, H. S. Teoh via Digitalmars-d пишет:
>>>> On Tue, Dec 09, 2014 at 07:16:56PM +0300, Dmitry Olshansky via Digitalmars-d wrote:
>>>>> 08-Dec-2014 18:18, H. S. Teoh via Digitalmars-d пишет:
>> [...]
>>>>>> Yeah, I find in my own experience that gdc -O3 tends to produce
>>>>>> code that's consistently ~20% faster than dmd -O, especially in
>>>>>> compute-intensive code.
>>>>>
>>>>> And that's not nearly enough. Also both LDC & GDC often can't inline
>>>>> many functions from phobos due to separate compilation.
>>>> [...]
>>>>
>>>> Really? Most of the Phobos function I use are templates, so inlining
>>>> shouldn't be a problem, should it? Besides, gdc is far better at
>>>> inlining that dmd ever was, though of course there are some
>>>> constructs that the front-end doesn't inline, and the backend doesn't
>>>> have enough info to do so. This is an area that should be improved.
>>>>
>>>
>>> std.ascii.isWhite ... and there are plenty of things our templates
>>> inevitably unfold to. I mean come on phobos library is big pile of
>>> object code, it can't be all templates.
>>>
>>> Last time I checked if you copy-paste isWhite it to your source code
>>> it gets much faster then std one because of inlining.
>> [...]
>>
>> Hmm. Would it help to change isWhite into a template function?
>>
>
> That can't be the answer for everything.
>

As someone (ab)using empty template "idiom", I agree, we need a better 
solution.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list