hspec-discover: Prevent GHC from overeagerly simplifying the generated code#958
hspec-discover: Prevent GHC from overeagerly simplifying the generated code#958sol wants to merge 1 commit into
Conversation
eb0c339 to
49fbf37
Compare
| , "spec = sequence_ [" ++ unwords [ | ||
| "describe \"Foo\" FooSpec.spec," | ||
| , "describe \"Foo.Bar\" Foo.BarSpec.spec," | ||
| , "describe \"Foo.Bar.Baz\" Foo.Bar.BazSpec.spec]" |
There was a problem hiding this comment.
interestingly enough, I remember having some major compile-time performance boons by switchig code from generating <> chains to using mconcat - I wonder if this is something that is generalizable...
parsonsmatt
left a comment
There was a problem hiding this comment.
I've tested this out on our codebase and ran several builds with the patch. Using our opentelemetry-plugin to get per-module level timing data, unfortunately, the hspec-discover enabled modules did not observe any speedup.
This graph shows builds of our TestGroup modules over the last 7 days. The spike on the far right shows builds now, with the patch enabled. Build times are slightly slower than without the patch. That's pretty surprising, but if you are observing improvements locally, then I wouldn't want to block on this.
One reason why I wouldn't block on this: this is with ghci and we have a heavily patched GHC 9.10.1 so it's entirely possile that we're tripping some regression that we introduced or there's some fix that we don't have incorporated.
|
@parsonsmatt sorry, this is not useful to me.
Given this, my expectation is that this PR, applied to your original situation, will bring build times down from 150s to somewhere in the ~2s range. @parsonsmatt are you willing to try this PR in isolation and confirm (or disproof) my expectation? Once we properly understand the impact of this PR, we can discuss any further steps (e.g. #954 or But please look at this PR in isolation (without #954), because from my experience mashing things together rarely gives you a clear picture of what's actually happening.
What is with |
I've already migrated our codebase over to Your own data suggests that your PR is a nice improvement. If I were you, I'd just merge it. We aren't observing any benefit per my prior data. But, that could just come down to our patched GHC version having some different behavior, so our data may not be representative anyway. The times that I'm looking at are with GHCi. The really long times I reported earlier are from a |
49fbf37 to
d0eeca7
Compare
No description provided.