Bug 16495 – __traits(fullyQualifedName) instead of std.traits.fullyQualifiedName

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-09-15T08:09:57Z
Last change time
2023-01-22T05:35:11Z
Keywords
pull
Assigned to
No Owner
Creator
Ethan Watson
See also
https://issues.dlang.org/show_bug.cgi?id=23528

Comments

Comment #0 by gooberman — 2016-09-15T08:09:57Z
std.traits.fullyQualifiedName has been identified as a significant slowdown during compile time. The implementation does a whole ton of analysis to reconstruct the requested name. The compiler already has this information though. Implementing as a trait and rewriting std.traits.fullyQualifiedName to use that will result in a solid speed up of compile times.
Comment #1 by b2.temp — 2019-02-13T05:55:22Z
I've added and tested such a new __trait. There are problems when using the raw output as produced by the compiler (Type.toPrettyChars(true) or DSymbol.toPrettyChars) 1. complex combinations of type qualifiers are not like expected by phobos unittests 2. template declarations include the constraints 3. handling of single template parameter (so w/o parens) is different It's probable that toPrettyChars uses the header gen, which is not adapted to produce the fqn. It's rather used to format the errors. But 80% of the tests pass.
Comment #2 by uplink.coder — 2019-02-13T16:27:18Z
I've already tried my hand at this. https://github.com/UplinkCoder/dmd/tree/fqn_trait please take what you like from this branch.
Comment #3 by b2.temp — 2019-02-13T17:12:12Z
Thanks I was sure you did something (i remember you made a video about the fqn perfs). I'm no surprised to see you didn't use the toPrettyChar but otherwise i see a difference in the way you get the symbol from the arg (for now I do like this https://github.com/Basile-z/dmd/commit/53f87a8575735d17b1a07a5e7d11ce2610d1b505#diff-ebdced6ed94b108576dceefdf3c3e021R1803) and i suspect this wan't working in some cases. So finally why didn't you make a PR ?
Comment #4 by bugzilla — 2022-12-17T14:43:36Z
Comment #5 by bugzilla — 2022-12-17T14:54:25Z
There might be a way to use a modified toPrettyChars to produce the same thing. Basile-z can you be more specific in the differences?
Comment #6 by dlang-bot — 2022-12-18T02:02:07Z
@WalterBright created dlang/dmd pull request #14711 "fix Issue 16495 - __traits(fullyQualifedName) instead of std.traits.f…" fixing this issue: - fix Issue 16495 - __traits(fullyQualifedName) instead of std.traits.fullyQualifiedName https://github.com/dlang/dmd/pull/14711
Comment #7 by dlang-bot — 2023-01-22T05:35:11Z
dlang/dmd pull request #14711 "fix Issue 16495 - __traits(fullyQualifedName) instead of std.traits.f…" was merged into master: - 4dc346fc31d69326c9c7d780c57c92c3a7fa9efe by Walter Bright: fix Issue 16495 - __traits(fullyQualifedName) instead of std.traits.fullyQualifiedName https://github.com/dlang/dmd/pull/14711