www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22435] New: -unittest causes all template instances to be

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 puremagic.com
          Reporter: atila.neves 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.

--
Oct 25 2021