[Issue 23464] New: Pathological compilation slowdown when mixin in large switches

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 5 21:37:10 UTC 2022


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

          Issue ID: 23464
           Summary: Pathological compilation slowdown when mixin in large
                    switches
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: deadalnix at gmail.com

Unfortunately, because this bug require to mix in a large switch, I'm not able
to share a small sample code.

You can find an example able to trigger the problem here:
https://github.com/snazzy-d/sdc/tree/compiletime

The compilation time is dominated by the mixin in lexHtmlEntity in lexstring.d

With this function, compiling the json lexer takes 45s on my system.
Without it, it takes 0.3s .

There seems to be something non linear somewhere, because similar switches are
mixed in in other places, but the one in lexHtmlEntity is definitively the
biggest one.

--


More information about the Digitalmars-d-bugs mailing list