Conversation
2d6aeb3 to
0ee0acb
Compare
s-ludwig
left a comment
There was a problem hiding this comment.
Funny coincidence that I was looking at template instantiations yesterday and also hit taggedalgebraic (mostly within visit, though). However, the improvements I got were within measuring tolerance, so I didn't follow through with it.
source/taggedalgebraic/taggedunion.d
Outdated
| { | ||
| static if (isUnitType!T) enum isHashable = true; | ||
| else static if (__traits(compiles, (ref const(T) val) @safe nothrow => hashOf(val))) | ||
| else static if (__traits(compiles, canHashOf(T.init))) |
There was a problem hiding this comment.
Isn't T.init generally not an lvalue, so that this will fail at the call site for canHashOf?
0ee0acb to
12a90aa
Compare
My terrible rule of thumb is that when compile times are bad is always std.format. Especially, CTFE with AliasSeq resulting in mixins. std.format is great it just compiles so slow. |
|
Yeah, By the way, the |
|
As far as I can see its not more code or templates per se, but its closeness to old style C. My approach is pretty simple, add
I agree std.format should compile faster, but I haven't gotten Walter yet to take a look. |
But you are certain that the specific change at line 784/800 does improve compile time, or is it just an independent relic? |
I'm not quite sure what you mean independent relic, but stepping through the compile trace this is a thing where the compile time is less of an overall smaller compile time in general |
|
I mean the main change is obviously avoiding the |
it is. its just avoids the creation of the delegate based on the template. Just say the word and I'll revert that change, its not the biggest win in comparison to the other changes. |
|
Since it changes semantics and in its current form creates two template function instantiations instead of one, I'd say we should just leave it out, unless there are in fact significant gains. |
12a90aa to
276e8f8
Compare
done |
std.format and std.numeric.gcd shows up quite heavily during tracing compile times. This PR removes two expansive format calls and introduces a super simple gcd algorithm.
|
@s-ludwig thank you for taking the time |
|
@s-ludwig any change I could get a v1.0.1 release? |
|
@s-ludwig thank you |
|
Okay, code.dlang.org is updated with 1.0.1 now. |
|
awesome, thank you my best project saves 0.2 seconds on a 2.5 seconds build and the biggest thing is codegen in ldc (about 1.2s) the frontend is mostly dpql denizzzka/dpq2#214 |
|
@burner There appears to be a pretty big compile-time improvement/regression fix related to |
that would be awesome, I'll keep an eye open thank you |
std.format and std.numeric.gcd shows up quite heavily during tracing compile times.
This PR removes two expansive format calls and introduces a super simple gcd algorithm.
Below are two traces building vibe.d with and without the changes. With the change compilation is about 7% faster on my machine.
trace_baseline.json
trace.json
I'm a big std.format fan, but its compile time is just bad.