Well, this only prints when that sysprop is set, and I want to get rid of
this anyway, once we've convinced ourselves that the code is reasonably
optimal. I had used these timers to squeeze performance gains out anywhere
I could, but the main remaining issue is the sbinary serialization of the
API objects...


On Thu, Nov 14, 2013 at 3:52 PM, Grzegorz Kossakowski <
notifications@github.com> wrote:

> In compile/persist/src/main/scala/sbt/inc/TextAnalysisFormat.scala:
>
> > +		val start = System.nanoTime()
> > +		val ret = f
> > +		val elapsed = System.nanoTime() - start
> > +		timers.update(key, timers.getOrElseUpdate(key, 0) + elapsed)
> > +		ret
> > +	}
> > +
> > +	def time[T](key: String)(f: => T) = {
> > +		val ret = aggregate(key)(f)
> > +		close(key)
> > +		ret
> > +	}
> > +
> > +	def close(key: String) {
> > +		if (printTimings) {
> > +			println("[%s] %dms".format(key, timers.getOrElse(key, 0L) / 1000000))
>
> I was thinking whether we would like to use proper logging API here but
> I'm guessing that just for printing timings this should be ok.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sbt/sbt/pull/985/files#r7677978>
> .
>