Skip to content

Enable optimisations in Expr.run #3830

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

Merged
merged 3 commits into from
Jan 15, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@smarter
Copy link
Member

smarter commented Jan 14, 2018

Optimizations have a significant impact on compilation time, and not much effect on running time, why should they be enabled by default?

@nicolasstucki
Copy link
Contributor Author

It should probably be an option of the run method. I will change it to be configurable and of by default.

@@ -13,10 +13,9 @@ import java.nio.charset.StandardCharsets

class QuoteDriver extends Driver {

def run[T](expr: Expr[T]): T = {
def run[T](expr: Expr[T], optimise: Boolean): T = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will work for now, but in the future if you want to be able to pass more options, it might make more sense to pass a Settings object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add it now to avoid future changes on the API.

@nicolasstucki nicolasstucki force-pushed the enable-optimise-in-quotes branch from 168e90e to 6be81fa Compare January 15, 2018 12:55
@nicolasstucki
Copy link
Contributor Author

@smarter this PR needs another review, I added Settings and a second useful setting for debugging purposes.

@@ -31,6 +31,7 @@ object Runners {
}

case class RunSettings(
optimise: Boolean = false
optimise: Boolean = false,
outDir: Option[String] = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outputDir, also document the meaning of Some/None here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do java -Djdk.internal.lambda.dumpProxyClasses=out to be able to debug the classes generated for lambda calls at runtime. Maybe we should have a -Ddotty.meta.dumpClasses or something for similar purpose.

@nicolasstucki nicolasstucki force-pushed the enable-optimise-in-quotes branch from 3dca938 to 873058b Compare January 15, 2018 14:27
@nicolasstucki nicolasstucki merged commit 9a654d7 into scala:master Jan 15, 2018
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.

2 participants