-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Small performance enhancements #4267
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
Small performance enhancements #4267
Conversation
test performance please |
performance test scheduled: 1 job(s) in queue, 1 running. |
|
||
/** perform context-dependant initialization */ | ||
override def prepareForUnit(tree: Tree)(implicit ctx: Context) = { | ||
primitiveGetClassMethods = Set[Symbol]() ++ defn.ScalaValueClasses().map(x => x.requiredMethod(nme.getClass_)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the improvement is that before prepareForUnit
returned all the symbols for getClass
methods, by generating stubsymbol
s were needed, and now it doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Mostly the cost was in creating the set.
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4267/ to see the changes. Benchmarks is based on merging with master (2f94916) |
@@ -105,7 +105,7 @@ class InterceptedMethods extends MiniPhase { | |||
List(qual, typer.resolveClassTag(tree.pos, qual.tpe.widen)))) | |||
}*/ | |||
*/ | |||
case t if primitiveGetClassMethods.contains(t) => | |||
case t if t.name == nme.getClass_ && scalaValueClasses.contains(t.owner) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could just do defn.ScalaValueClasses.contains, no need for the intermediate variable.
test performance please |
performance test scheduled: 2 job(s) in queue, 1 running. |
There is some performance regression on some of the exhaustivity benchmarks. I will investigate before merging. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/4267/ to see the changes. Benchmarks is based on merging with master (2f94916) |
Actually the performance regression was on master. |
No description provided.