From 30479c0e1283201f905e2129970ad4784c9c5ba2 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 3 Jun 2010 01:26:30 -0400 Subject: 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. --- src/annotate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/annotate.cc') diff --git a/src/annotate.cc b/src/annotate.cc index 99c12fc3..feb3b3ca 100644 --- a/src/annotate.cc +++ b/src/annotate.cc @@ -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); -- cgit v1.2.3