[Issue 24052] DMD frontend inliner causes major slowdown
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Jul 21 10:27:06 UTC 2023
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24052
Dennis <dkorpel at live.nl> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|DMD is slow to pass dlangui |DMD frontend inliner causes
                   |github pipelines            |major slowdown
--- Comment #5 from Dennis <dkorpel at live.nl> ---
Actually, this looks like an issue with the frontend inliner, so no duplicate.
Reduction so far:
```D
struct EmbeddedResource
{
    string a;
    const ubyte[] b;
    string c;
}
EmbeddedResource[] embedResource(string resourceName)()
{
    immutable ubyte[] data = [0, 1, 2, 3, 4];
    immutable string resdir = "res";
    static if (data.length > 0)
        return [EmbeddedResource(resourceName, data, resdir)];
    else
        return [];
}
EmbeddedResource[] embedResources(string[] names)() {
    static if (names.length == 0)
        return [];
    static if (names.length == 1)
        return embedResource!(names[0])();
    else
        return embedResources!(names[0 .. $/2])() ~ embedResources!(names[$/2
.. $])();
}
enum string[] stringArray = () {
    string[350] result;
    static foreach (i; 0 .. result.length)
        result[i] = "test" ~ i.stringof;
    return result;
} ();
void main()
{
    embedResources!stringArray();
}
```
--
    
    
More information about the Digitalmars-d-bugs
mailing list