-
Notifications
You must be signed in to change notification settings - Fork 121
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
Zinc extract used names is very sluggish #187
Conversation
c0dee50
to
2ff883f
Compare
2ff883f
to
e69f831
Compare
Compilation of shapeless with Zinc is very slow. Potential reason lays in multiple visit in already traversed tree.
e69f831
to
79a119d
Compare
override def traverse(tree: Tree): Unit = { | ||
if (!inspectedTrees.contains(tree)) { | ||
if (handleTree(tree)) | ||
inspectedTrees += tree | ||
super.traverse(tree) |
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.
Does this handle macro expansion?
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.
sorry @eed3si9n it's not. Going to fix. Looks like there is no test to discover it.
I would suggest to incorporate sbt/sbt#2754 into Zinc (I've lodged typesafehub/zinc#105 to track this work). When I profiled the slowness of Shapeless with SBT + Scala 2.12, I initially was looking at ways to optimize name extraction but eventually found out that the slowness was (mostly) due to the poor interaction with JIT. |
Actually, I see now that 33e9a50 appears to introduce exponential performance by (accidentally?) introducing AFAICT, this problem is only introduces in sbt/zinc, not in the incremental compiler in SBT 0.13.x |
@retronym Thanks for the detective work. |
I opened #193 as a replacement for this PR. |
superseded by #193 |
Ref sbt/zinc#187 Rewritten from sbt/zinc@23ed4ef
Compilation of shapeless with Zinc is very slow. Potential reason lays in
multiple visit in already traversed tree.
Please look at least at test. This file should be processed in about 5 sec. but actually takes about 5 mins.