From fb91d6f21e341f12d80e95195322837cbda78cf3 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 21 Aug 2004 03:23:17 -0400 Subject: add copy-on-write semantics to amount.cc; cuts object creation by 5x --- binary.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'binary.cc') diff --git a/binary.cc b/binary.cc index 6c31f574..61276a7c 100644 --- a/binary.cc +++ b/binary.cc @@ -1,13 +1,7 @@ #include "ledger.h" #include "binary.h" -#include -#include -#include -#include #include -#include - #include #define TIMELOG_SUPPORT 1 @@ -26,11 +20,11 @@ bool binary_parser_t::test(std::istream& in) const return magic == binary_magic_number; } -static std::vector accounts; -static account_t::ident_t ident; -static std::vector commodities; -static commodity_t::ident_t c_ident; - +static std::deque accounts; +static account_t::ident_t ident; +static std::deque commodities; +static commodity_t::ident_t c_ident; +std::deque bigints; #if RELEASE_LEVEL >= ALPHA #define read_binary_guard(in, id) { \ @@ -258,6 +252,7 @@ unsigned int read_binary_journal(std::istream& in, accounts.clear(); commodities.clear(); + bigints.clear(); return count; } -- cgit v1.2.3