Problems with dmd inlining
Brad Roberts
braddr at puremagic.com
Sat Dec 11 20:36:31 PST 2010
On 12/11/2010 8:22 PM, Craig Black wrote:
> I did some benchmarking with a simple quick sort algorithm and was very
> disappointed that dmd was over twice as slow as Visual C++. Investigation
> revealed most of the slowness was due to the fact that dmd was not inlining a
> simple function that returned a reference. After hand-inlining some code, I got
> within 20% of the performance of Visual C++. I don't see this as acceptable.
> The main reason that I want to use D is so that my code will be cleaner. If I
> have to inline my own functions then this will not result in clean code.
>
> Anyway, has anyone else had problems with dmd's inliner? Should I post a bug
> report or has someone else already complained about this?
>
> -Craig
There's a number of things that currently stop dmd from inlining. Several exist
as bug reports. I don't recall if there's one about ref return results or not.
These limitations are certainly worth working to lift, but they're lower
priority than a lot of other bugs. That said, they're the sort of thing I enjoy
trying to fix, so go ahead and file a nice tiny test case.
As always, if there's issues you care a lot about, the source code for the
compiler is there for anyone to work with.
Later,
Brad
More information about the Digitalmars-d
mailing list