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
| if (!inspectedTrees.contains(tree)) { | ||
| if (handleTree(tree)) | ||
| inspectedTrees += tree | ||
| super.traverse(tree) |
There was a problem hiding this comment.
Does this handle macro expansion?
There was a problem hiding this comment.
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.