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

Optimizations in tail calls #3448

Merged
merged 3 commits into from Feb 2, 2014
Merged

Conversation

retronym
Copy link
Member

Review by @gkossakowski

From the "if a tree falls" department: don't bother create a finely
distinguished error messages about why the transform is inapplicable
if the current context doesn't demand it.
Only store the position and reason for a failure to tailcall
transform a method if we ever need to report it, ie, if the
method was annotated with @tailrec.

Saves object hashing and map updates, profiling suggests
that this reduces the tailcalls phase from about 2% of compilation
time to about 1%.

Also, clear the maps eagerly after each compilation unit,
rather than letting them accumulate entries for the entire
run. Working with smaller maps can't hurt.
@soc
Copy link
Member

soc commented Jan 31, 2014

This LGTM!

@ghost ghost assigned gkossakowski Feb 1, 2014
@gkossakowski
Copy link
Member

LGTM.

Thanks for detailed explanations in commit messages.

gkossakowski added a commit that referenced this pull request Feb 2, 2014
@gkossakowski gkossakowski merged commit fc15cfc into scala:master Feb 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants