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

Improve stack consumption of Eval.Call #769

Merged
merged 1 commit into from
Jan 5, 2016

Conversation

DavidGregory084
Copy link
Member

I think that the awesome speed boost for Eval introduced by Eval.Call has broken the stack-safety of Eval.defer and that this is the reason that the FoldableTestsAdditional suite is failing now and then.
I have tried to reduce the stack consumption of Eval.Call by forcing thunks in such a way that the compiler can eliminate most of the stack.

@codecov-io
Copy link

Current coverage is 88.48%

Merging #769 into master will decrease coverage by -0.03% as of bc8d823

@@            master    #769   diff @@
======================================
  Files          166     166       
  Stmts         2289    2293     +4
  Branches        74      74       
  Methods          0       0       
======================================
+ Hit           2026    2029     +3
  Partial          0       0       
- Missed         263     264     +1

Review entire Coverage Diff as of bc8d823

Powered by Codecov. Updated on successful CI builds.

@non
Copy link
Contributor

non commented Jan 4, 2016

Thanks! (And sorry for the late comments.)

The approach seems good, and I'm glad you added a test. (I assume it was failing before?)

👍

@DavidGregory084
Copy link
Member Author

It was failing, but would only do so reliably with a small thread stack size, e.g. -Xss256k. Do you have any thoughts as to how we can test this without setting such an artificially small stack size?

I forgot to say but the benchmark results for Eval were not significantly worse that I could tell. :)

@ceedubs
Copy link
Contributor

ceedubs commented Jan 5, 2016

👍 thanks!

ceedubs added a commit that referenced this pull request Jan 5, 2016
@ceedubs ceedubs merged commit 38d4a35 into typelevel:master Jan 5, 2016
aryairani added a commit to aryairani/cats that referenced this pull request Jan 5, 2016
@DavidGregory084 DavidGregory084 deleted the eval-defer-stack-safety branch January 6, 2016 20:17
adelbertc added a commit that referenced this pull request Jan 10, 2016
factor out a static inner method from #769 for better GC
@DavidGregory084 DavidGregory084 mentioned this pull request Mar 10, 2016
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

Successfully merging this pull request may close these issues.

4 participants