Speed-up PCH builds

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Speed-up PCH builds

Fangrui Song via cfe-dev

Hello,

 

There’s a pending review, https://reviews.llvm.org/D69585, which greatly speeds up building of codebases using PCH + heavy use of templates.

Previously, template instantiations would only happen at the end of the TU which includes the PCH. I’ve seen codebases with 5+ sec spent in each TU because of this.

With this patch, instantiations are allowed to happen at the end of the PCH, which shaves a few seconds in each TU including the PCH. This behavior is behind a new flag.

 

It would be much appreciated if anybody knowledgeable of the subject could take a look at this please?

 

Many thanks in advance!

Alex.

 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Speed-up PCH builds

Fangrui Song via cfe-dev
Judging by the lack of responses here, it feels like there aren't a lot of active stakeholders in clang's PCH behavior.

It seems pretty clear that there is a performance use case for instantiating templates at the end of the PCH.

I think your plan to land this under a flag sounds good, and then if other users care we can discuss changing the default later.

On Wed, May 13, 2020 at 9:27 AM Alexandre Ganea via cfe-dev <[hidden email]> wrote:

Hello,

 

There’s a pending review, https://reviews.llvm.org/D69585, which greatly speeds up building of codebases using PCH + heavy use of templates.

Previously, template instantiations would only happen at the end of the TU which includes the PCH. I’ve seen codebases with 5+ sec spent in each TU because of this.

With this patch, instantiations are allowed to happen at the end of the PCH, which shaves a few seconds in each TU including the PCH. This behavior is behind a new flag.

 

It would be much appreciated if anybody knowledgeable of the subject could take a look at this please?

 

Many thanks in advance!

Alex.

 

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev