[Issue 22435] New: -unittest causes all template instances to be emitted

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 25 16:46:39 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22435

          Issue ID: 22435
           Summary: -unittest causes all template instances to be emitted
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: atila.neves at gmail.com

With a file that's only one line: `import std.uni;`, it takes 4x longer to
compile with -unittest than not. The reason is that `needsCodegen` always (in
essence, in practice it's slightly more complicated) returns true when
-unittest is passed even for non-root modules, and importing Phobos means
generating code for all of them.

--


More information about the Digitalmars-d-bugs mailing list