A simple, yet significiant, optimization

Every annotated commodity is based on a "referent", or the unannotated
version of that commodity.  When stripping all annotations away,
however, rather than simply returning the referent we were actually
searching for it by name.  There was no reason to do this, not to
mention it was taking up to 7% of the total runtime of some reports.
This commit is contained in:
John Wiegley 2010-06-03 01:26:30 -04:00
parent 4a0236e964
commit 30479c0e12

View file

@ -190,7 +190,7 @@ annotated_commodity_t::strip_annotations(const keep_details_t& what_to_keep)
keep_date ? details.date : none,
keep_tag ? details.tag : none));
} else {
new_comm = pool().find_or_create(base_symbol());
new_comm = &referent();
}
assert(new_comm);