Try splitting up What4.Expr.Builder
to improve compile times
#220
Labels
enhancement
New feature or request
performance
Issues related to compile-time or runtime performance
what4
's compile times are rather slow, and especially so on GHC 9.0 and earlier. On our CI, GHC 9.0 takes about 13 minutes to build, most of it coming from theWhat4.Expr.Builder
module. The story is even more dire for non-x86 architectures. On Debian's build servers, for instance, buildingwhat4
times out on the armhf architecture after compilingWhat4.Expr.Builder
for 150 minutes straight (see here). That is so egregiously slow that I cannot help but wonder if there is some other GHC issue at play, but the point remains:What4.Expr.Builder
is uncomfortably slow to build.One idea for improving the compile times is to split up
What4.Expr.Builder
module into several smaller modules. While this is not guaranteed to improve compile times, my experiences with GHC suggest that this usually provides a modest boost. If nothing else, it would force us to reconsider if we really need to put as much stuff intoWhat4.Expr.Builder
as it currently contains.It is worth noting that the story is far improved on GHC 9.2, which features a much more efficient pattern-match coverage checker. On GHC 9.2,
what4
takes about 3 minutes to build, which is about 10 minutes faster than previous versions of GHC. Indeed, most ofWhat4.Expr.Builder
consists of this one instance, which pushes the pattern exhaustiveness checker to its absolute limits. Nevertheless, it still takes 3 minutes to build—perhaps we can still do better.The text was updated successfully, but these errors were encountered: