1) Projects are discovered reflectively again. I really didn't want any reflective discovery in 0.9, but forgetting to add a project is a preventable error, so I did it. The consequence is that you have to either delete your 'lazy val projects = Seq(...)' line (enabling reflective discovery) or add 'override' to it (to continue manually listing projects). If you stick with manually listing them, lazy val is not strictly necessary for 'projects'. A def is fine.
2) Keys are now backed by a Manifest in order to fix issue #27. The consequence is you can define keys inline multiple times as long as the type is the same. Something that might break is if you did this before, because adding the Manifest breaks type inference:
https://issues.scala-lang.org/browse/SI-4653
An example, both of these can go in the same build file:
TaskKey[Int]("demo") := 3
TaskKey[Int]("demo") += 2
Before, you would get an error about a key collision (to ensure type safety). SI-4653 means the [Int] part is required.
As always, thanks for the feedback so far.
-Mark
I made a couple of changes that will impact users running off of the 0.9 branch (and then releases starting with 0.9.9).
> On Friday, 27 May 2011 03:29:00 UTC+1, Mark Harrah wrote:
> >
> > I made a couple of changes that will impact users running off of the 0.9
> > branch (and then releases starting with 0.9.9).
>
> Thanks Mark, I agree with both changes. It's nice not to need to add all the
> projects manually for the default case and being able to define keys
> multiple times also makes the builds less error-prone (I had run across this
> problem myself in a shared method that created some settings and was used
> from multiple other methods).
In general, I think it is still better to explicitly declare keys globally. Not that you disagree, but now seems like a good time to mention it. That way, you can refer to a key in Scala, get the compiler to check that you spelled it right, and not have to duplicate the type definition. Keys should also have descriptions and you don't want to duplicate or omit that either.
> With 0.10 approaching quickly and the release of 2.9.0.1 a few days ago, it
> would be nice to move SBT to 2.9.0.1 and then release 0.9.9 soon so that the
> combination can get some testing. Is that your plan?
I've been undecided on 2.9, but you're right that a decision needs to happen now. Let's do the following. If you are using 0.9.8, please get a rough idea of how long common actions take (whatever is important to you: startup time, project compilation time, build compilation time, adding a setting with 'set', ...). I will make 0.9.9 based on 2.9.0-1 this weekend. Recheck your timings and of course note any correctness issues. If we encounter serious problems that would be difficult to resolve quickly or require 2.9.0-1 + 1, we can revert to 2.8.1 and revisit the issue after 0.10.0. Does that sound reasonable?
-Mark
I've been undecided on 2.9, but you're right that a decision needs to happen now. Let's do the following. If you are using 0.9.8, please get a rough idea of how long common actions take (whatever is important to you: startup time, project compilation time, build compilation time, adding a setting with 'set', ...). I will make 0.9.9 based on 2.9.0-1 this weekend. Recheck your timings and of course note any correctness issues. If we encounter serious problems that would be difficult to resolve quickly or require 2.9.0-1 + 1, we can revert to 2.8.1 and revisit the issue after 0.10.0. Does that sound reasonable?
In general, I think it is still better to explicitly declare keys globally. Not that you disagree, but now seems like a good time to mention it. That way, you can refer to a key in Scala, get the compiler to check that you spelled it right, and not have to duplicate the type definition. Keys should also have descriptions and you don't want to duplicate or omit that either.
I've been undecided on 2.9, but you're right that a decision needs to happen now. Let's do the following. If you are using 0.9.8, please get a rough idea of how long common actions take (whatever is important to you: startup time, project compilation time, build compilation time, adding a setting with 'set', ...). I will make 0.9.9 based on 2.9.0-1 this weekend. Recheck your timings and of course note any correctness issues. If we encounter serious problems that would be difficult to resolve quickly or require 2.9.0-1 + 1, we can revert to 2.8.1 and revisit the issue after 0.10.0. Does that sound reasonable?
Great, thanks. I will try to get it out today.
-Mark
I have found 2.9.0 to be slower for an important case. Start up sbt and modify a setting from the command line, like:
$ sbt
> set name := "demo"
For sbt 0.9.8 + Scala 2.8.1, this takes 7 s for me. For sbt 0.9.9 + Scala 2.9.0-1, this takes 17 s. I reverted 0.9.10-SNAPSHOT locally to 2.8.1 and it returns to 7 s. I time this using:
$ time sbt 'set name := "demo"' < /dev/null
(You need to delete project/target/ between runs to clear the compiled settings cache.)
You can see the difference in compiling "object A" with 2.9.0-1 (4.1 s) and Scala trunk (1.7 s). I expect this is all startup time, since trunk includes improvements related to startup time. Therefore, I am inclined to revert to 2.8.1 for 0.10.0 and revisit 2.9.x when the startup time improvements in trunk are included in a 2.9.x version.
-Mark
For sbt 0.9.8 + Scala 2.8.1, this takes 7 s for me. For sbt 0.9.9 + Scala 2.9.0-1, this takes 17 s. I reverted 0.9.10-SNAPSHOT locally to 2.8.1 and it returns to 7 s. I time this using:
I expect this is all startup time, since trunk includes improvements related to startup time. Therefore, I am inclined to revert to 2.8.1 for 0.10.0 and revisit 2.9.x when the startup time improvements in trunk are included in a 2.9.x version.
For sbt 0.9.9 + Scala 2.9.0-1, this takes 17 s.
> On Monday, 30 May 2011 22:49:08 UTC+1, Mark Harrah wrote:
> >
> > For sbt 0.9.8 + Scala 2.8.1, this takes 7 s for me. For sbt 0.9.9 + Scala
> > 2.9.0-1, this takes 17 s. I reverted 0.9.10-SNAPSHOT locally to 2.8.1 and
> > it returns to 7 s. I time this using:
> >
> Ouch! That's pretty bad. I feared that start-up would take a significant hit
> due to all the new classes in 2.9.
I'm not sure what the cause is yet, but plain sbt startup time without a 'set' action doesn't appear to be much affected. I thought Paul's work that improved the startup time was on mainly compiler-related classes, but I could be wrong.
> > I expect this is all startup time, since trunk includes improvements
> > related to startup time. Therefore, I am inclined to revert to 2.8.1 for
> > 0.10.0 and revisit 2.9.x when the startup time improvements in trunk are
> > included in a 2.9.x version.
> >
> I think that makes sense. Would that have to wait until the series after
> 0.10.x or could it be done as part of the 0.10.x series?
I think moving to 2.9 would mean going to 0.11. I don't think there would be much practical difference compared with going from 0.10.x to 0.10.x+1. That is, the only reason for the bump would be for moving to Scala, and not because build files and plugins need drastic changes like 0.7->0.9.
> Incidentally, I was in the process of doing some performance testing myself
> when I saw your commit reverting to 2.8.1 a few minutes ago. Given your
> results, it seems like it's better to postpone such testing for later.
Yes, I agree.
-Mark
I repeated it multiple times in the same manner for each version. You can reproduce it from my previous instructions. (Be sure that you actually switch between 0.9.8 and 0.9.9). Independent confirmation would of course be useful.
-Mark
#!/usr/bin/env bash
#
# paulp's variation
#
for home in $@; do
PATH=$home/bin:$PATH
which scala
echo ""
scala -version
rm -f *.class
scalac A.scala
time scala A
echo ""
done
% ./run.sh /scala/inst/281 /scala/inst/29 /scala/inst/pack
/scala/inst/281/bin/scala
Scala code runner version 2.8.1.final -- Copyright 2002-2010, LAMP/EPFL
I'm live
real 0m0.701s
user 0m0.954s
sys 0m0.093s
/scala/inst/29/bin/scala
Scala code runner version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
I'm live
real 0m0.610s
user 0m0.762s
sys 0m0.103s
/scala/inst/pack/bin/scala
Scala code runner version 2.10.0.r-b20110530164830 -- Copyright
2002-2011, LAMP/EPFL
I'm live
real 0m0.454s
user 0m0.582s
sys 0m0.074s
The original comparison of sbt 0.9.8 and 0.9.9 is the important one. I repeated the tests and got the same result.
-Mark
On Mon, 30 May 2011 16:33:03 -0700 (PDT)
anli <andrew....@gmail.com> wrote:
> For this A.scala
>
> object A {
> def main(args: Array[String]) : Unit = {
> println("I'm live")
> }
> }
>
> and this script
>
> #!/bin/bash
>
> #SCALA_HOME="/wrk/dev/scala/2.8.1"
> SCALA_HOME="/wrk/dev/scala/2.9.0.1"
>
> PATH=$SCALA_HOME/bin:$PATH
> scala -version
> rm -f *.class
> scalac A.scala
> time scala A
>
> I have got this output of *the second* script run for 2.8.1
-Mark
% ./run.sh /scala/inst/281 /scala/inst/29 /scala/inst/pack
/scala/inst/281/bin/scala
Scala code runner version 2.8.1.final -- Copyright 2002-2010, LAMP/EPFL
real 0m4.727s
user 0m8.879s
sys 0m0.426s
I'm live
real 0m0.718s
user 0m0.942s
sys 0m0.109s
/scala/inst/29/bin/scala
Scala code runner version 2.9.0.1 -- Copyright 2002-2011, LAMP/EPFL
real 0m4.738s
user 0m9.484s
sys 0m0.429s
I'm live
real 0m0.606s
user 0m0.768s
sys 0m0.099s
/scala/inst/pack/bin/scala
Scala code runner version 2.10.0.r25041-b20110530181906 -- Copyright 2002-2011, LAMP/EPFL
real 0m2.220s
user 0m3.592s
sys 0m0.265s
I'm live
real 0m0.453s
user 0m0.580s
sys 0m0.073s
It is indeed interesting that 2.8.1 and 2.9.0-1 appear to have little difference for compiling a simple file (and I can reproduce this). It means that the cause is less obvious, but that is a secondary point.
It looks like you are using a xsbt 0.9.x launcher to run sbt 0.7.x.
-Mark
I've tried to only publish stable sbt releases using the previous
stable release. It isn't as important as properly bootstrapping a
compiler, but it is still important for reproducibility.
> OK, I have reproduced your tests and got
Thanks for verifying this.
-Mark