From d39934e7b960f7f82251cf27e50160d826287c89 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 13 Nov 2016 13:31:31 -0500 Subject: [PATCH] Context: Eliminated commit timer --- src/Context.cpp | 4 ++-- src/Context.h | 2 +- src/TDB2.cpp | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 2cb965ae6..e7d7968cd 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -328,7 +328,7 @@ int Context::run () << " load:" << static_cast (timer_load.total_us ()) << " gc:" << time_gc_us - tdb2.load_time_us << " filter:" << time_filter_us - << " commit:" << static_cast (timer_commit.total_us ()) + << " commit:" << time_commit_us << " sort:" << static_cast (timer_sort.total_us ()) << " render:" << static_cast (timer_render.total_us ()) << " hooks:" << static_cast (timer_hooks.total_us ()) @@ -338,7 +338,7 @@ int Context::run () time_gc_us - tdb2.load_time_us - time_filter_us - - timer_commit.total_us () - + time_commit_us - timer_sort.total_us () - timer_render.total_us () - timer_hooks.total_us ()) diff --git a/src/Context.h b/src/Context.h index b7645a6d5..fd636fb46 100644 --- a/src/Context.h +++ b/src/Context.h @@ -103,7 +103,7 @@ public: Timer timer_load; long time_gc_us {0}; long time_filter_us {0}; - Timer timer_commit; + long time_commit_us {0}; Timer timer_sort; Timer timer_render; Timer timer_hooks; diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 8b2f12fc9..da4f3a133 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -740,6 +740,8 @@ void TDB2::update ( //////////////////////////////////////////////////////////////////////////////// void TDB2::commit () { + Timer timer; + // Ignore harmful signals. signal (SIGHUP, SIG_IGN); signal (SIGINT, SIG_IGN); @@ -749,10 +751,7 @@ void TDB2::commit () signal (SIGUSR2, SIG_IGN); dump (); - context.timer_commit.start (); - gather_changes (); - pending.commit (); completed.commit (); undo.commit (); @@ -766,7 +765,7 @@ void TDB2::commit () signal (SIGUSR1, SIG_DFL); signal (SIGUSR2, SIG_DFL); - context.timer_commit.stop (); + context.time_commit_us += timer.total_us (); } ////////////////////////////////////////////////////////////////////////////////