On inlining in D libraries
Dmitry Olshansky
dmitry.olsh at gmail.com
Sun Sep 15 14:51:30 PDT 2013
15-Sep-2013 23:05, Andrej Mitrovic пишет:
> On 9/15/13, monarch_dodra <monarchdodra at gmail.com> wrote:
>> By simply making them templates, I can improve the performance of
>> functions such as "split on ascii white" by 2 to 3 (!).
>
Yes, yes and yes. I think many of the performance issues of Phobos are
rooted there.
I'm of the opinion that the user must not suffer because of a undecided
situation with inlining in the toolchain (all of them).
> Speaking of which, I think the following special case should be allowed:
>
> -----
> void foo()() { }
>
> void main()
> {
> auto x = &foo; // NG
> }
> -----
>
> Then maybe we won't even break anyone's code.
>
Providing either this special case for empty argument templates seems to
be a small price to help this ugly situation.
That is unless compiler devs agree with the following observation and
see a way to get there in short-term:
> I *thought* that the intended behavior is:
> a) Have source - compile from source
> b) Don't have source (*.di files) - link in objects
Which is something nobody clarified yet.
Well Johannes spoke for GDC by noting that there is no notion to support
that in the current frontend-backend dialog.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list