Skip to content

Some more small optimizations #3216

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 2 commits into from
Oct 3, 2017
Merged

Conversation

smarter
Copy link
Member

@smarter smarter commented Sep 30, 2017

No description provided.

@smarter smarter requested a review from odersky September 30, 2017 14:06
@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

test performance please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

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

Benchmarks is based on merge(s) with master

@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

Note that points for today's PRs are missing in the benchmarks linked above, so the comparison is misleading. You can look at it side-by-side with http://dotty-bench.epfl.ch/3214 instead.

@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

Interestingly this is the first time in a while that we have a code change that affects the speed of the empty class/object/file benchmarks, and in a good way too :).

@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

Morale: Java reflection is not only evil, it's also very slow, be careful!

private def hasRedefinedMethod(cls: Class[_], name: String): Boolean = {
val clsMethods = cls.getDeclaredMethods
if (cls.eq(classOf[TreeTransform]) || cls.eq(classOf[NoTreeTransform]) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Not clear we need this anymore, because of ed5eb24.

We have just reduced the # of calls to this method by a factor 7.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's more of a micro-optimization now. I can remove the added cache map if you think it's not worth the complexity now.

It turns out that this method takes time because getDeclaredMethods take
time, so we avoid calling it when possible.
@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

test performance please: be01457 6fd9569 128afcc

@dottybot
Copy link
Member

performance test scheduled for be01457 6fd9569 128afcc: 1 job(s) in queue, 0 running.

@liufengyun
Copy link
Contributor

FYI @smarter Now the points for one PR accumulate, so it's possible to test multiple variations of the same PR continuously and see all the points in one graph.

@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

Cool! That's useful, but at the same time could be misleading if master changed since the last benchmarks for the PR, maybe the info bubble for the points should mention which commit from master was merged with which commit from the PR?

@liufengyun
Copy link
Contributor

The simplest solution is to just update the bot message to make it clear that which commit is merged with which master(hash). Does that address the concern?

Note it's also possible to provide a command retest performance please to erase previous points and accumulate again. This can be useful in rebasing.

@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

This all sounds like good ideas :). Instead of erasing previous points, I suggest using a different URL when retesting instead.

@dottybot
Copy link
Member

Performance test finished successfully:

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

Benchmarks is based on merge(s) with master

@smarter
Copy link
Member Author

smarter commented Sep 30, 2017

@odersky Looks like the hasRedefinedMethod optimizations are still significant (in http://dotty-bench.epfl.ch/3216/ compare 6fd9569 to the previous point which is master, especially for empty file/object/class)

@liufengyun
Copy link
Contributor

retest performance please: be01457 6fd9569 128afcc

@dottybot
Copy link
Member

dottybot commented Oct 1, 2017

performance test scheduled for be01457 6fd9569 128afcc: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

dottybot commented Oct 1, 2017

Performance test finished successfully:

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

Benchmarks is based on merging with master (be01457)

@liufengyun
Copy link
Contributor

Github doesn't always pickup the index.html page automatically:

http://dotty-bench.epfl.ch/3216-2/index.html

@liufengyun
Copy link
Contributor

test performance please

Test for the PR liufengyun/bench#63

@dottybot
Copy link
Member

dottybot commented Oct 2, 2017

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

@dottybot
Copy link
Member

dottybot commented Oct 2, 2017

Performance test finished successfully:

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

Benchmarks is based on merging with master (1dda6e1)

@allanrenucci allanrenucci merged commit 0dd8688 into scala:master Oct 3, 2017
@allanrenucci allanrenucci deleted the more-opts 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.

5 participants