Skip to content
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

Add INLINE pragma on try and tryJust #81

Open
harendra-kumar opened this issue Jun 18, 2021 · 3 comments
Open

Add INLINE pragma on try and tryJust #81

harendra-kumar opened this issue Jun 18, 2021 · 3 comments

Comments

@harendra-kumar
Copy link

Somehow GHC-9.0.1 is not able to inline this which blocks specialization also. See this composewell/streamly#1061 (comment) . It will be helpful if there is an INLINE pragma on it.

@RyanGlScott
Copy link
Collaborator

Do you have a standalone example of a program that doesn't simplify the way you'd expect because of this? I'm not opposed to adding an INLINE pragma to these functions, but it would be helpful to have a test case to ensure that they actually are providing the benefits that one would expect.

@harendra-kumar
Copy link
Author

I do not have a standalone program as a test case. But we have an elaborate benchmarking suite in streamly which shows several benchmarks regressing, on examining the core we found MonadCatch dictionary being passed, and the fix is in this commit. The regressions are around 200% as shown in this comment.

@RyanGlScott
Copy link
Collaborator

I'd like to have a regression test for this in exceptions as well (probably using inspection-testing in a different package so as not to complicate exceptions.cabal, which is a GHC boot library). Ideally, I could proactively verify that the INLINE pragma is actually doing what it says instead of reacting to user bug reports later, when the damage has already been done. This is especially important given that exceptions comes bundled with GHC, so it takes longer for changes to make their way out into the ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants