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

Eliminate the use of asInstanceOf in Eval. #924

Closed
wants to merge 1 commit into from

Conversation

TomasMikula
Copy link
Contributor

No description provided.

@codecov-io
Copy link

Current coverage is 88.98%

Merging #924 into master will increase coverage by +0.04% as of 3fc1faa

@@            master    #924   diff @@
======================================
  Files          179     179       
  Stmts         2125    2124     -1
  Branches        42      42       
  Methods          0       0       
======================================
  Hit           1890    1890       
  Partial          0       0       
+ Missed         235     234     -1

Review entire Coverage Diff as of 3fc1faa

Powered by Codecov. Updated on successful CI builds.

@ceedubs
Copy link
Contributor

ceedubs commented Mar 13, 2016

@non If I recall, you put some effort into optimizing this. Any thoughts?

@non
Copy link
Contributor

non commented May 30, 2016

Hey @TomasMikula! Sorry this has been hanging out so long.

Do you have a sense of the relative performance before and after? I'll try to look at some benchmarks myself, but there could be a difference. The change to allow tailrec is interesting -- I'm not sure if the overall effect will be better or worse.

Let me know if you have some results to share, or if you are going to work on this. I'll try to get to it when I have some time to look into it (I may need similar benchmarks to continue working on #989).

@TomasMikula
Copy link
Contributor Author

TomasMikula commented May 30, 2016

I haven't done any benchmarking. My primary goal was to get rid of asInstanceOfs and uses of Any. It's hard to tell how it will perform relative to the original code. There seems to be one more allocation per iteration of re-associating to the right in my code. On the other hand, it avoids those asInstanceOfs (not sure how costly they are at runtime).

@non
Copy link
Contributor

non commented May 31, 2016

OK thanks. I'll try to do some tests and comment here when I know more.

@non
Copy link
Contributor

non commented Jul 13, 2016

I haven't done the benchmarking and don't anticipate doing it anytime soon.

@TomasMikula I feel bad having your PR sitting here, and don't expect it to be merged soon. Would you mind if I closed it? I could open an issue encouraging us to investigate whether the casts are needed.

@TomasMikula
Copy link
Contributor Author

No need to feel bad. I didn't anticipate there would be a performance concern when I opened the PR.

@non non closed this Jul 17, 2016
@TomasMikula
Copy link
Contributor Author

scala/scala#6065 would make it possible to eliminate those asInstanceOf calls without introducing extra allocations.

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.

None yet

4 participants