Skip to content

Avoid creating closure for asserts #3267

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 1 commit into from
Oct 6, 2017

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

test performance please

@dottybot
Copy link
Member

dottybot commented Oct 5, 2017

performance test scheduled: 19 job(s) in queue, 1 running.

@nicolasstucki nicolasstucki force-pushed the micro-optimizations-1 branch from 02141bf to d852465 Compare October 5, 2017 14:30
@odersky
Copy link
Contributor

odersky commented Oct 5, 2017

Did you check the bytecode that this does in fact inline? Just being paranoiac here.

Otherwise LGTM

@nicolasstucki
Copy link
Contributor Author

Yes it does inline, but the generated code is a bit larger.
I would prefer patching the assert I found problematic by hand.

@nicolasstucki
Copy link
Contributor Author

While compiling dotty.tools.dotc.core e2f4be6 reduces the time of FlagSet.| from 0.911 sec to 0.010 sec.

I would drop the first commit. The standard library already has this @inline in the Predef.assert but it is ignored by dotty as it is compiled in scala2 mode. My solution may improve it a bit.

@odersky
Copy link
Contributor

odersky commented Oct 5, 2017

I think we can keep the first commit. There are other asserts, where it would be nice to give them a second parameter without fear that a closure will be created.

@dottybot
Copy link
Member

dottybot commented Oct 5, 2017

performance test failed:

Error line number: 16

[check /data/workspace/bench/logs/pull-3267-10-05-20.54.out for more information]

1 similar comment
@dottybot
Copy link
Member

dottybot commented Oct 5, 2017

performance test failed:

Error line number: 16

[check /data/workspace/bench/logs/pull-3267-10-05-20.54.out for more information]

@dottybot
Copy link
Member

dottybot commented Oct 5, 2017

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3267/ to see the changes.

Benchmarks is based on merging with master (af528a1)

@nicolasstucki nicolasstucki force-pushed the micro-optimizations-1 branch from e2f4be6 to d852465 Compare October 6, 2017 09:59
@nicolasstucki
Copy link
Contributor Author

Removed the second commit

@odersky odersky merged commit caa2bc5 into scala:master Oct 6, 2017
@allanrenucci allanrenucci deleted the micro-optimizations-1 branch December 14, 2017 19:23
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.

3 participants