Summary:
The compiletime project is an attempt to better understand the relationship between the use of Scala's features and compile time. This article gives a quick overview of what we've learned so far.
The ability to add new comments in this discussion is temporarily disabled.
Most recent reply: February 14, 2013 0:50 AM by
Channing
|
The compiletime project is an attempt to better understand the relationship between the use of Scala's features and compile time. This article gives a quick overview of what we've learned so far. http://www.artima.com/articles/compile_time.html
|
|
|
Thanks Bill for this very detailed post. I can confirm that the effect of using an abstract class instead of a trait is a dramatic improvement for specs2 (from 225s to compile the full project to 133s).
About the comparison of the matchers and the effect of having a double by-name in specs2, it'd be nice to measure specs2 again with "1 + 1 must beEqualTo(2)" instead of "1 + 1 must be equalTo(2)" because in the second case there's one more implicit being called.
E.
|
|
|
How are you doing that Eric? Is it just a case of creating a new abstract class extending Specification, or do mean changing Specification to be abstract?
Channing
|
|
|
> Thanks Bill for this very detailed post. I can confirm > that the effect of using an abstract class instead of a > trait is a dramatic improvement for specs2 (from 225s to > compile the full project to 133s). > That's an awesome improvement. Is that about a half second per test class? Because that's what the results would have predicted.
> About the comparison of the matchers and the effect of > having a double by-name in specs2, it'd be nice to measure > specs2 again with "1 + 1 must beEqualTo(2)" instead of "1 > + 1 must be equalTo(2)" because in the second case there's > one more implicit being called. > Can you do a pull request on the compiletime project? I didn't realize there was a beEqualTo.
Bill
|
|
|
I did what Bill recommended: changed Specification to SpecificationLike and added "abstract class Specification extends SpecificationLike". I also re-published specs2 1.12.4-SNAPSHOT (for scala 2.9.2) and 1.13.1-SNAPSHOT (for scala 2.10) so if you use one of those 2 you should see some improvement.
|
|
|
Yes, that's approximately that:
- 176 test classes / 2 = 88 - 225 - 133 = 92
It's interesting to see that it is that predictable. That'd be interesting to see which other projects in the community are compiling lots of entities to traits and would benefit from this.
> Can you do a pull request on the compiletime project? I didn't realize there was a beEqualTo.
I just did.
E.
|
|
|