Skip to content

Commit

Permalink
Print name table size after compilation under -verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed Feb 27, 2019
1 parent 4483d73 commit 4a64e1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/compiler/scala/tools/nsc/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,8 @@ class Global(var currentSettings: Settings, reporter0: LegacyReporter)

// Clear any sets or maps created via perRunCaches.
perRunCaches.clearAll()
if (settings.verbose)
println("Name table size after compilation: " + nameTableSize + " chars")
}

/** Compile list of abstract files. */
Expand Down
1 change: 1 addition & 0 deletions src/reflect/scala/reflect/internal/Names.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ trait Names extends api.Names {
/** Memory to store all names sequentially. */
var chrs: Array[Char] = new Array[Char](NAME_SIZE)
private[this] var nc = 0
final def nameTableSize: Int = nc

/** Hashtable for finding term names quickly. */
private[this] val termHashtable = new Array[TermName](HASH_SIZE)
Expand Down

0 comments on commit 4a64e1f

Please sign in to comment.