diff options
author | Martin Odersky <odersky@gmail.com> | 2012-08-18 11:22:15 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-08-20 08:11:11 +0100 |
commit | ebb719fb92a50476ba51e4be8e87571ff4949551 (patch) | |
tree | b06640514a8c57920c03b549ae54151df16a09f7 /src | |
parent | bc4e1442b4f7942ffb64bdcc15ce93600611576b (diff) | |
download | scala-ebb719fb92a50476ba51e4be8e87571ff4949551.tar.gz scala-ebb719fb92a50476ba51e4be8e87571ff4949551.tar.bz2 scala-ebb719fb92a50476ba51e4be8e87571ff4949551.zip |
Slightly less drastic disabling of statistics.
All statistics code is now subject to a switch at each use site, as opposed to a compile-time constant before. We should veryfy that this does not affect performance. Statistics is a useful ability to have for trouble-shooting compile time speeds on specific code bases. But we should not pay a lot for having it on normal runs.
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/util/Statistics.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/reflect/scala/reflect/internal/util/Statistics.scala b/src/reflect/scala/reflect/internal/util/Statistics.scala index e077e38fb6..f7b81ca252 100644 --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala @@ -236,19 +236,19 @@ quant) private var _enabled = false private val qs = new mutable.HashMap[String, Quantity] - - /** replace with - * - * final val canEnable = true - * - * and rebuild, to allow for statistics to be enabled - */ - final val canEnable = false - - /** replace with - * + + /** replace with + * + * final val canEnable = false + * + * to remove all Statistics code from build + */ + final val canEnable = _enabled + + /** replace with + * * final def hotEnabled = _enabled - * + * * and rebuild, to also count tiny but super-hot methods * such as phase, flags, owner, name. */ |