printStats(): Print the size of the symbol table in bytes
This commit is contained in:
parent
9deb822180
commit
7bdb85453d
3 changed files with 15 additions and 0 deletions
|
@ -1262,6 +1262,7 @@ void EvalState::printStats()
|
|||
printMsg(v, format(" right-biased unions: %1%") % nrOpUpdates);
|
||||
printMsg(v, format(" values copied in right-biased unions: %1%") % nrOpUpdateValuesCopied);
|
||||
printMsg(v, format(" symbols in symbol table: %1%") % symbols.size());
|
||||
printMsg(v, format(" size of symbol table: %1%") % symbols.totalSize());
|
||||
printMsg(v, format(" number of thunks: %1%") % nrThunks);
|
||||
printMsg(v, format(" number of thunks avoided: %1%") % nrAvoided);
|
||||
printMsg(v, format(" number of attr lookups: %1%") % nrLookups);
|
||||
|
|
|
@ -336,4 +336,16 @@ string ExprLambda::showNamePos()
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* Symbol table. */
|
||||
|
||||
size_t SymbolTable::totalSize() const
|
||||
{
|
||||
size_t n = 0;
|
||||
foreach (Symbols::const_iterator, i, symbols)
|
||||
n += i->size();
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -89,6 +89,8 @@ public:
|
|||
{
|
||||
return symbols.size();
|
||||
}
|
||||
|
||||
size_t totalSize() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue