Internals: Optimize temporary memory allocations (#6517)

This patch gets rid of over 80% of temporary dynamic memory allocations
(when a malloced node is immediately freed with no other malloc in
between). It also gets rid of over 20% of all calls to malloc.

It's worth ~3% average verilation speed up with tcmalloc, and more
without tcmalloc.
This commit is contained in:
Geza Lore
2025-10-01 15:01:30 +01:00
committed by GitHub
parent 435e1149d5
commit e9c48cd1ce
19 changed files with 218 additions and 216 deletions
-5
View File
@@ -169,11 +169,6 @@ public:
//######################################################################
// Top Stats class
void V3Stats::addStatSum(const string& name, double count) VL_MT_SAFE_EXCLUDES(s_mutex) {
V3LockGuard lock{s_mutex};
addStat(V3Statistic{"*", name, count, 0, true});
}
void V3Stats::statsStageAll(AstNetlist* nodep, const std::string& stage, bool fastOnly) {
StatsVisitor{nodep, stage, fastOnly};
}