[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [llvm-bugs] [Bug 61064] [Modules] Increased build times across translation units
From:       LLVM Bugs via llvm-bugs <llvm-bugs () lists ! llvm ! org>
Date:       2023-02-28 18:24:27
Message-ID: 20230228182427.aa4a94dacb87a760 () email ! llvm ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61064>61064</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Modules] Increased build times across translation units
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          koplas
      </td>
    </tr>
</table>

<pre>
    Given the following translation units:

```C++
export module a;

export namespace a {
 int a_0() {return 0;}
    int a_1() {return 0;}
    int a_2() {return 0;}
...
    int a_1000000() {return 0;}
}
```

```C++

export module b;
import a;

export namespace b {
    int b() {
        return 1;
 }
}
```

```C++
export module c;
import b;

export namespace c {
    int c() {
        return b::b();
 }
}
```

And running the following:
```Bash
echo &quot;Building a.cppm&quot;
time clang++ -std=c++20 --precompile a.cppm -o a.pcm
time clang++ -std=c++20 a.cppm -c -o a.o
echo &quot;Building b.cppm&quot;
time clang++ -std=c++20 -fprebuilt-module-path=. --precompile b.cppm -o b.pcm
time clang++ -std=c++20 -fprebuilt-module-path=. b.cppm -c -o b.o
echo &quot;Building c.cppm&quot;
time clang++ -std=c++20 -fprebuilt-module-path=. --precompile c.cppm -o c.pcm
time clang++ -std=c++20 -fprebuilt-module-path=. c.cppm -c -o c.o
```

Results in this output:
```
Building a.cppm

real    0m25,961s
user 0m24,515s
sys     0m1,337s

real    1m23,304s
user 1m20,309s
sys     0m2,856s

Building b.cppm

real 0m2,201s
user    0m1,978s
sys     0m0,220s

real 0m5,779s
user    0m5,373s
sys     0m0,400s

Building c.cppm

real    0m2,146s
user    0m1,957s
sys 0m0,187s

real    0m5,714s
user    0m5,317s
sys 0m0,389s
```

As expected the build times of a.cppm is high. However, even the build of c.cppm \
takes a lot of time. Note that in the precompiling phase of b.cppm and c.cppm circa \
200 ms is spent in `WriteAst`, despite not having many lines of code.

[build-times-test.zip](https://github.com/llvm/llvm-project/files/10853435/build-times-test.zip)


</pre>
<img width="1px" height="1px" alt="" \
src="http://email.email.llvm.org/o/eJy0Vk1v4zYQ_TX0ZWCBGn364ENsw20P7aGXHguKGlvsUqQgUtl \
Nf31BfTh27E02aCsISjTkPL43fhxROKfOhmjLsh3LDisx-Mb22y-208KtKlu_bH9Sz2TANwQnq7X9qswZfC-M0 \
8Ira2AwyjuWPDF-YHx55ny69wx34R6j9K2zvYfW1oMmECzZXefMo0a05DohCQSwYp4ByngQf3KGJcNNiPfkh94 \
ADyDFYZ4FME-Mf3Qivj8xiqI7aD5e7-e9_rMU4uPqPKpRdamRasf4h0Wrroo2c65eub4OhGtmHl8w4V8JuKUu3 \
1KvPqIu76nLD6hXwXfJ06zw0zqeTA39YMxo6WuDv9p5SdsJ18y8ZWOBIe4GpeuQKSLZdS1DnMa9agmkFuY8FQf \
WztcsOcjpFTms111P0radCttgzIa1BRF1sv1RjCVNTpn2O9yqT3M7dT1Vg9J-Pf2Q6074hiWH6JZ2daFdfYb2O \
_DVtaLqu4rk_6VIXhTJ_0iRvFYkF0UPnfg7uUF7Byp0WuXADr4b_L0Np9e31rsC6knosEF4ixnD_SaP3TQwOOp \
DNGW4z-JsjroXB9P0mOE-SQr3CCxuMQnDPL0Gi1vkY3RzB4YM92WW34C99eTbdaYs5DeEL9Q2RXm3Slgdkd9T5 \
m3QXhSbO6gQT4rkIVTK-WPC8r0qM9zHaf6Yc1ZcLTQtEpePSzxTjtPHlON7pKRc5D3ubQ7oW0fSUz32tmDRGoK \
fHdjT0j-Ug0admwh-tl_pmXqGe6Dlez-l2NNiZC--kAMB2voQDVjz5_E36wl8I_xkYILLvgr16xrhKGTMW1yYe \
oGUqpcCkHNoXSDjOjIjCMv5H73y9OR8EIZ7qMl1yhMY66ERzwG4FeYFtDKTJGnrhc_8zHajhPWoeu3J-ehv1bH \
swLBsvO_GYwseGR7PyjdDFUnbMjxq_bz8WXe9_YukZ3g8KU2O4THmZZakScbw-BAdN9Pqq3qb1JtkI1a0jfOiy \
HmZ58Wq2YpUFCLPRMILUdcZx6osUaYZVngi4rRSW-SYcMQyLjHFIhIiFZu0FrIqC1HknKWcWqF0FChGtj-vlHM \
DbfOY5-lKi4q0G090iIa-wjgYOmZ2WPXbUVY1nB1LuVbOu1cUr7wej4K_jp3MsewAvxjZk3BU3zhIyN46d38OXA293n66tCPBUNtRwD8BAAD__5OQBXo">



[Attachment #3 (text/plain)]

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic