-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC: INLINE parser combinators #591
Conversation
@phadej: Thank you! 🙂 The test failure is weird and seems like it should not be related to this change at all. I'm digging into it |
@phadej: Oh, I know what the problem is. You also need to implement |
Thanks again! |
Before I merge, is there any reason not to merge this? This was titled a "Proof of concept" but it looks fine to me. Is it just because there are other things which could be inlined? |
@Gabriel439 I'm not entirely sure this is optimization. It seems that this actually doesn't really affect non-profiled build. And with profiled, both
(I'm using GHC-8.2.2 btw, will try 8.4.3 next) |
The last commit is something one might want to profile in separation. On my machine it halved the time taken by |
Then I think we should go ahead and merge this whenever you're ready. It can't hurt and it will make it easier to profile if we eliminate profiling false positives caused by the absence of inlining |
This way GHC can be smarter, e.g. reserved and keyword disappear from the profiling output
Ok, I run out of low hanging fruits: master
prof
There is 20-25% speedup now. |
Alright, then I'll go ahead and merge this |
On my machine, trying
dhall-kubernetes/examples/deployment.dhall
the execution time drops significantly:The flip side of the coin, is that
Token
module tortures GHC with all stuff wanting to INLINE. Yet SPJ said about a week agoin https://ghc.haskell.org/trac/ghc/ticket/15630, so that issue might go away.
I'm not sure inlining on which (set of) functor/applicative/alternative/monad combinator(s) contributes the most, but seems that here as well, inlining composition combinators pays off in run time.
I hope that @f-f or someone else can continue from here. Cheers.