mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Context: Eliminated load timer
This commit is contained in:
parent
e906b20014
commit
5a5195fbb2
4 changed files with 16 additions and 18 deletions
|
@ -88,7 +88,6 @@ Context::~Context ()
|
||||||
int Context::initialize (int argc, const char** argv)
|
int Context::initialize (int argc, const char** argv)
|
||||||
{
|
{
|
||||||
timer_total.start ();
|
timer_total.start ();
|
||||||
Timer timer_init;
|
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -293,7 +292,7 @@ int Context::initialize (int argc, const char** argv)
|
||||||
std::cerr << e << '\n';
|
std::cerr << e << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
time_init_us += timer_init.total_us ();
|
time_init_us += timer_total.total_us ();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,6 +310,7 @@ int Context::run ()
|
||||||
hooks.onExit (); // No chance to update data.
|
hooks.onExit (); // No chance to update data.
|
||||||
|
|
||||||
timer_total.stop ();
|
timer_total.stop ();
|
||||||
|
time_total_us += timer_total.total_us ();
|
||||||
|
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << "Perf "
|
s << "Perf "
|
||||||
|
@ -325,24 +325,22 @@ int Context::run ()
|
||||||
<< ISO8601d ().toISO ()
|
<< ISO8601d ().toISO ()
|
||||||
|
|
||||||
<< " init:" << time_init_us
|
<< " init:" << time_init_us
|
||||||
<< " load:" << static_cast <long> (timer_load.total_us ())
|
<< " load:" << time_load_us
|
||||||
<< " gc:" << time_gc_us - tdb2.load_time_us
|
<< " gc:" << time_gc_us - time_load_us
|
||||||
<< " filter:" << time_filter_us
|
<< " filter:" << time_filter_us
|
||||||
<< " commit:" << time_commit_us
|
<< " commit:" << time_commit_us
|
||||||
<< " sort:" << time_sort_us
|
<< " sort:" << time_sort_us
|
||||||
<< " render:" << time_render_us
|
<< " render:" << time_render_us
|
||||||
<< " hooks:" << time_hooks_us
|
<< " hooks:" << time_hooks_us
|
||||||
<< " other:" << static_cast <long> (timer_total.total_us () -
|
<< " other:" << time_total_us -
|
||||||
time_init_us -
|
time_init_us -
|
||||||
timer_load.total_us () -
|
time_gc_us -
|
||||||
time_gc_us -
|
time_filter_us -
|
||||||
tdb2.load_time_us -
|
time_commit_us -
|
||||||
time_filter_us -
|
time_sort_us -
|
||||||
time_commit_us -
|
time_render_us -
|
||||||
time_sort_us -
|
time_hooks_us
|
||||||
time_render_us -
|
<< " total:" << time_total_us
|
||||||
time_hooks_us)
|
|
||||||
<< " total:" << static_cast <long> (timer_total.total_us ())
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
debug (s.str ());
|
debug (s.str ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,8 +99,9 @@ public:
|
||||||
int terminal_height {0};
|
int terminal_height {0};
|
||||||
|
|
||||||
Timer timer_total {};
|
Timer timer_total {};
|
||||||
|
long time_total_us {0};
|
||||||
long time_init_us {0};
|
long time_init_us {0};
|
||||||
Timer timer_load;
|
long time_load_us {0};
|
||||||
long time_gc_us {0};
|
long time_gc_us {0};
|
||||||
long time_filter_us {0};
|
long time_filter_us {0};
|
||||||
long time_commit_us {0};
|
long time_commit_us {0};
|
||||||
|
|
|
@ -425,7 +425,7 @@ void TF2::load_tasks (bool from_gc /* = false */)
|
||||||
throw e + format (STRING_TDB2_PARSE_ERROR, _file._data, line_number);
|
throw e + format (STRING_TDB2_PARSE_ERROR, _file._data, line_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.tdb2.load_time_us += timer.total_us ();
|
context.time_load_us += timer.total_us ();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -154,7 +154,6 @@ public:
|
||||||
TF2 completed;
|
TF2 completed;
|
||||||
TF2 undo;
|
TF2 undo;
|
||||||
TF2 backlog;
|
TF2 backlog;
|
||||||
long load_time_us {};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _location;
|
std::string _location;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue