Jump to page: 1 27  
Page
Thread overview
template statistics
Jun 02, 2020
Walter Bright
Jun 02, 2020
FeepingCreature
Jun 02, 2020
Stefan Koch
Jun 02, 2020
Stefan Koch
Jun 03, 2020
FeepingCreature
Jun 03, 2020
Stefan Koch
Jun 02, 2020
Ethan
Jun 03, 2020
Walter Bright
Jun 03, 2020
Adam D. Ruppe
Jun 03, 2020
Walter Bright
Jun 03, 2020
Stefan Koch
Jun 04, 2020
Stefan Koch
Jun 03, 2020
Nick Treleaven
Jun 03, 2020
Walter Bright
Jun 04, 2020
Jacob Carlborg
Jun 04, 2020
Nick Treleaven
Jun 03, 2020
Adam D. Ruppe
Jun 04, 2020
Walter Bright
Jun 03, 2020
Adam D. Ruppe
Jun 03, 2020
Stefan Koch
Jun 03, 2020
Adam D. Ruppe
Jun 03, 2020
Walter Bright
Jun 03, 2020
Stefan Koch
Jun 04, 2020
Stefan Koch
Jun 05, 2020
Stefan Koch
Jun 05, 2020
Stefan Koch
Jun 05, 2020
Adam D. Ruppe
Jun 05, 2020
H. S. Teoh
Jun 05, 2020
Adam D. Ruppe
Jun 05, 2020
H. S. Teoh
Jun 05, 2020
Walter Bright
Jun 03, 2020
Stanislav Blinov
Jun 03, 2020
Paul Backus
Jun 03, 2020
Walter Bright
Jun 03, 2020
Stanislav Blinov
Jun 03, 2020
Stanislav Blinov
Jun 04, 2020
Stanislav Blinov
Jun 04, 2020
Walter Bright
Jun 04, 2020
Adam D. Ruppe
Jun 04, 2020
Adam D. Ruppe
Jun 04, 2020
Walter Bright
Jun 04, 2020
Stanislav Blinov
Jun 03, 2020
Max Samukha
Jun 04, 2020
Jacob Carlborg
Jun 05, 2020
Stanislav Blinov
Jun 03, 2020
Basile B.
Jun 03, 2020
Stefan Koch
Jun 03, 2020
jmh530
Jun 03, 2020
Stefan Koch
Jun 03, 2020
Paul Backus
Jun 03, 2020
Stefan Koch
Jun 03, 2020
jmh530
Jun 04, 2020
Jacob Carlborg
Jun 04, 2020
Stefan Koch
Jun 04, 2020
jmh530
Jun 03, 2020
Atwork
Jun 05, 2020
James Lu
Jun 06, 2020
Jean-Louis Leroy
Jun 06, 2020
Stefan Koch
Jun 06, 2020
Jean-Louis Leroy
Jun 06, 2020
Stefan Koch
June 01, 2020
Many people are trying to figure out what templates are blowing up their compile. This should help:

https://github.com/dlang/dmd/pull/11208
June 02, 2020
On Tuesday, 2 June 2020 at 06:47:54 UTC, Walter Bright wrote:
> Many people are trying to figure out what templates are blowing up their compile. This should help:
>
> https://github.com/dlang/dmd/pull/11208

Nice!

Wishlist: if you could dump out a template instantiation backtrace combined with system time for every template declaration start and end, it should be easy to convert this into callgrind format ( https://valgrind.org/docs/manual/cl-format.html ), which would let us use graphical profilers with it.
June 02, 2020
On Tuesday, 2 June 2020 at 08:37:35 UTC, FeepingCreature wrote:
> On Tuesday, 2 June 2020 at 06:47:54 UTC, Walter Bright wrote:
>> Many people are trying to figure out what templates are blowing up their compile. This should help:
>>
>> https://github.com/dlang/dmd/pull/11208
>
> Nice!
>
> Wishlist: if you could dump out a template instantiation backtrace combined with system time for every template declaration start and end, it should be easy to convert this into callgrind format ( https://valgrind.org/docs/manual/cl-format.html ), which would let us use graphical profilers with it.

Ah I didn't know the callgrind format was documented :)
I can give you that I already have something similar for my own profiling.
June 02, 2020
On Tuesday, 2 June 2020 at 08:37:35 UTC, FeepingCreature wrote:
> On Tuesday, 2 June 2020 at 06:47:54 UTC, Walter Bright wrote:
>> Many people are trying to figure out what templates are blowing up their compile. This should help:
>>
>> https://github.com/dlang/dmd/pull/11208
>
> Nice!
>
> Wishlist: if you could dump out a template instantiation backtrace combined with system time for every template declaration start and end, it should be easy to convert this into callgrind format ( https://valgrind.org/docs/manual/cl-format.html ), which would let us use graphical profilers with it.

Check this branch out.
https://github.com/UplinkCoder/dmd/tree/dmd_tracing_2092
It doesn't do the cl-format.
But it should help in showing how-to add such per-symbol performance info
June 02, 2020
On Tuesday, 2 June 2020 at 06:47:54 UTC, Walter Bright wrote:
> Many people are trying to figure out what templates are blowing up their compile. This should help:
>
> https://github.com/dlang/dmd/pull/11208

Oh I have *got* to try this out on my code.

(Just need to find the time right now...)
June 02, 2020
On 6/2/2020 5:53 AM, Ethan wrote:
> Oh I have *got* to try this out on my code.

I tried it on `writeln("hello");` and the number of templates instantiated seems excessive. It should be investigated.

  Number   Unique   Name
      46       38   MAKEINTRESOURCE_T(ushort i)
      38        0   OldAlias(T) if (!isAggregateType!T || is(Unqual!T == T))
       7        6   staticIndexOf(T, TList...)
       1        1   Impl(T)
       7        5   isSomeChar(T)
       2        1   StringTypeOf(T)
       1        1   Impl(T)
       8        2   mostNegative(T) if (isNumeric!T || isSomeChar!T || isBoolean!T)
       1        1   encode(Flag useReplacementDchar = No.useReplacementDchar)(out char[4] buf, dchar c)
       7        7   ModifyTypePreservingTQ(alias Modifier, T)
       2        1   Unqual(T)
       1        1   put(A)(A writeme) if ((isSomeChar!(Unqual!(ElementType!A)) || is(ElementType!A : const(ubyte))) && i
sInputRange!A && !isInfinite!A)
       1        1   decodeImpl(bool canIndex, Flag useReplacementDchar = No.useReplacementDchar, S)(auto ref S str, ref
size_t index) if (is(S : const(char[])) || isInputRange!S && is(Unqual!(ElementEncodingType!S) == char))
       3        1   isCallable(T...) if (T.length == 1)
       1        1   trustedFwrite(T)(FILE* f, const T[] obj)
       2        1   _utfException(Flag useReplacementDchar)(string msg, dchar c)
       1        1   popFront(C)(ref C[] str) if (Autodecoding && isNarrowString!(C[]))
       2        2   IntegralTypeOf(T)
       1        1   Impl(T)
       1        1   Impl(T)
      20       20   genericIndexOf(args...) if (args.length >= 1)
       1        1   safeOp(T0, T1)(auto ref T0 a, auto ref T1 b)
       5        1   ElementEncodingType(R)
       1        1   errnoEnforce(T, string file = __FILE__, uint line = __LINE__)(T value, lazy string msg = null)
       1        1   Impl(T)
       2        2   put(C)(C c) if (isSomeChar!C || is(C : const(ubyte)))
       2        1   exception(S)(S str, string msg)
       6        1   isNarrowString(T)
       2        1   at(R)(R[] r, size_t i)
       1        1   FunctionTypeOf(func...) if (func.length == 1 && isCallable!func)
       1        1   MinType(T...) if (T.length >= 1)
       5        0   AliasSeq(TList...)
       4        1   opDispatch(string name)
       1        1   min(T...)(T args) if (T.length >= 2)
       8        8   sndAlias(char c0, char c1)
       1        1   __equals(T1, T2)(T1[] lhs, T2[] rhs)
      55       13   isAggregateType(T)
       8        2   isNumeric(T)
       7        7   OriginalType(T)
       4        1   isInputRange(R)
       1        1   empty(T)(in T[] a)
       6        3   ElementType(R)
      36       11   expectType(T)
      24        7   Unqual(T)
       1        1   MAKEINTATOM_T()(int i)
       1        1   writeln(T...)(T args)
       1        1   Impl(T)
       3        1   isSomeString(T)
       1        1   isSomeFunction(T...) if (T.length == 1)
      15        2   TypeDef(T)
       1        1   isInfinite(R)
       3        1   isStaticArray(T)
      18       18   isSame(ab...) if (ab.length == 2)
       2        1   front(T)(T[] a) if (Autodecoding && isNarrowString!(T[]))
       1        1   decode(Flag useReplacementDchar = No.useReplacementDchar, S)(auto ref S str, ref size_t index) if (i
sSomeString!S)
       1        1   codeUnitLimit(S) if (isSomeChar!(ElementEncodingType!S))
       2        1   Parameters(func...) if (func.length == 1 && isCallable!func)
       1        1   fd_set_custom(uint SETSIZE)
       4        4   mmioFOURCC(char c0, char c1, char c2, char c3)
       2        1   Demangle(T)
       4        3   Flag(string name)
       1        1   safeOp(string S) if (S == "<" || S == ">" || S == "<=" || S == ">=" || S == "==" || S == "!=")
       2        2   isIntegral(T)
       1        1   Impl(T)
       5        5   CharTypeOf(T)
June 03, 2020
On Wednesday, 3 June 2020 at 02:32:54 UTC, Walter Bright wrote:
>       46       38   MAKEINTRESOURCE_T(ushort i)

This is a ported C macro in the Windows headers; a fixed cost (as in it won't grow with your program).

But it also doesn't have to exist - it could just be a CTFE function, or even just written out inline (all it does is cast a value to a different type!)


>       38        0   OldAlias(T) if (!isAggregateType!T || is(Unqual!T == T))

Now this one is a private template inside std.traits and I honestly don't understand why it exists. I suspect it was to paper over a compiler bug in the past and probably is now just unchanged out of fear of breakage.


Most the rest are reflection helpers in Phobos, many of which could prolly be trivially replaced with inline checks but .... maybe not a big deal anyway. idk.
June 03, 2020
On Wednesday, 3 June 2020 at 02:32:54 UTC, Walter Bright wrote:
> On 6/2/2020 5:53 AM, Ethan wrote:
>> Oh I have *got* to try this out on my code.
>
> I tried it on `writeln("hello");` and the number of templates instantiated seems excessive. It should be investigated.
>
>   Number   Unique   Name
>       46       38   MAKEINTRESOURCE_T(ushort i)
>       38        0   OldAlias(T) if (!isAggregateType!T || is(Unqual!T == T))
>        7        6   staticIndexOf(T, TList...)
>        1        1   Impl(T)
>        7        5   isSomeChar(T)
>        2        1   StringTypeOf(T)
>        1        1   Impl(T)
>        8        2   mostNegative(T) if (isNumeric!T || isSomeChar!T || isBoolean!T)
>        1        1   encode(Flag useReplacementDchar = No.useReplacementDchar)(out char[4] buf, dchar c)
>        7        7   ModifyTypePreservingTQ(alias Modifier, T)
>        2        1   Unqual(T)
>        1        1   put(A)(A writeme) if ((isSomeChar!(Unqual!(ElementType!A)) || is(ElementType!A : const(ubyte))) && i
> sInputRange!A && !isInfinite!A)
>        1        1   decodeImpl(bool canIndex, Flag useReplacementDchar = No.useReplacementDchar, S)(auto ref S str, ref
> size_t index) if (is(S : const(char[])) || isInputRange!S && is(Unqual!(ElementEncodingType!S) == char))
>        3        1   isCallable(T...) if (T.length == 1)
>        1        1   trustedFwrite(T)(FILE* f, const T[] obj)
>        2        1   _utfException(Flag useReplacementDchar)(string msg, dchar c)
>        1        1   popFront(C)(ref C[] str) if (Autodecoding && isNarrowString!(C[]))
>        2        2   IntegralTypeOf(T)
>        1        1   Impl(T)
>        1        1   Impl(T)
>       20       20   genericIndexOf(args...) if (args.length >= 1)
>        1        1   safeOp(T0, T1)(auto ref T0 a, auto ref T1 b)
>        5        1   ElementEncodingType(R)
>        1        1   errnoEnforce(T, string file = __FILE__, uint line = __LINE__)(T value, lazy string msg = null)
>        1        1   Impl(T)
>        2        2   put(C)(C c) if (isSomeChar!C || is(C : const(ubyte)))
>        2        1   exception(S)(S str, string msg)
>        6        1   isNarrowString(T)
>        2        1   at(R)(R[] r, size_t i)
>        1        1   FunctionTypeOf(func...) if (func.length == 1 && isCallable!func)
>        1        1   MinType(T...) if (T.length >= 1)
>        5        0   AliasSeq(TList...)
>        4        1   opDispatch(string name)
>        1        1   min(T...)(T args) if (T.length >= 2)
>        8        8   sndAlias(char c0, char c1)
>        1        1   __equals(T1, T2)(T1[] lhs, T2[] rhs)
>       55       13   isAggregateType(T)
>        8        2   isNumeric(T)
>        7        7   OriginalType(T)
>        4        1   isInputRange(R)
>        1        1   empty(T)(in T[] a)
>        6        3   ElementType(R)
>       36       11   expectType(T)
>       24        7   Unqual(T)
>        1        1   MAKEINTATOM_T()(int i)
>        1        1   writeln(T...)(T args)
>        1        1   Impl(T)
>        3        1   isSomeString(T)
>        1        1   isSomeFunction(T...) if (T.length == 1)
>       15        2   TypeDef(T)
>        1        1   isInfinite(R)
>        3        1   isStaticArray(T)
>       18       18   isSame(ab...) if (ab.length == 2)
>        2        1   front(T)(T[] a) if (Autodecoding && isNarrowString!(T[]))
>        1        1   decode(Flag useReplacementDchar = No.useReplacementDchar, S)(auto ref S str, ref size_t index) if (i
> sSomeString!S)
>        1        1   codeUnitLimit(S) if (isSomeChar!(ElementEncodingType!S))
>        2        1   Parameters(func...) if (func.length == 1 && isCallable!func)
>        1        1   fd_set_custom(uint SETSIZE)
>        4        4   mmioFOURCC(char c0, char c1, char c2, char c3)
>        2        1   Demangle(T)
>        4        3   Flag(string name)
>        1        1   safeOp(string S) if (S == "<" || S == ">" || S == "<=" || S == ">=" || S == "==" || S == "!=")
>        2        2   isIntegral(T)
>        1        1   Impl(T)
>        5        5   CharTypeOf(T)

looks like abstractions are not zero cost in fine
June 02, 2020
On 6/2/2020 7:41 PM, Adam D. Ruppe wrote:
> Most the rest are reflection helpers in Phobos, many of which could prolly be trivially replaced with inline checks but .... maybe not a big deal anyway. idk.

The thing is, `writeln("hello")` can be expanded to `core.stdc.stdio.puts("hello")`. Done.

Phobos seems to do a lot of "going around the Horn" instead of taking the canal.
June 03, 2020
On Wednesday, 3 June 2020 at 03:19:37 UTC, Walter Bright wrote:
> On 6/2/2020 7:41 PM, Adam D. Ruppe wrote:
>> Most the rest are reflection helpers in Phobos, many of which could prolly be trivially replaced with inline checks but .... maybe not a big deal anyway. idk.
>
> The thing is, `writeln("hello")` can be expanded to `core.stdc.stdio.puts("hello")`. Done.
>
> Phobos seems to do a lot of "going around the Horn" instead of taking the canal.

I have been saying that for years.

Apparently you never used `-vcg-ast`.
« First   ‹ Prev
1 2 3 4 5 6 7