mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Context: Eliminated render timer
This commit is contained in:
parent
473eaec923
commit
e906b20014
4 changed files with 18 additions and 18 deletions
|
@ -330,17 +330,17 @@ int Context::run ()
|
||||||
<< " 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:" << static_cast <long> (timer_render.total_us ())
|
<< " render:" << time_render_us
|
||||||
<< " hooks:" << time_hooks_us
|
<< " hooks:" << time_hooks_us
|
||||||
<< " other:" << static_cast <long> (timer_total.total_us () -
|
<< " other:" << static_cast <long> (timer_total.total_us () -
|
||||||
time_init_us -
|
time_init_us -
|
||||||
timer_load.total_us () -
|
timer_load.total_us () -
|
||||||
time_gc_us -
|
time_gc_us -
|
||||||
tdb2.load_time_us -
|
tdb2.load_time_us -
|
||||||
time_filter_us -
|
time_filter_us -
|
||||||
time_commit_us -
|
time_commit_us -
|
||||||
time_sort_us -
|
time_sort_us -
|
||||||
timer_render.total_us () -
|
time_render_us -
|
||||||
time_hooks_us)
|
time_hooks_us)
|
||||||
<< " total:" << static_cast <long> (timer_total.total_us ())
|
<< " total:" << static_cast <long> (timer_total.total_us ())
|
||||||
<< '\n';
|
<< '\n';
|
||||||
|
|
|
@ -105,7 +105,7 @@ public:
|
||||||
long time_filter_us {0};
|
long time_filter_us {0};
|
||||||
long time_commit_us {0};
|
long time_commit_us {0};
|
||||||
long time_sort_us {0};
|
long time_sort_us {0};
|
||||||
Timer timer_render;
|
long time_render_us {0};
|
||||||
long time_hooks_us {0};
|
long time_hooks_us {0};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ ViewTask::~ViewTask ()
|
||||||
//
|
//
|
||||||
std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& sequence)
|
std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& sequence)
|
||||||
{
|
{
|
||||||
context.timer_render.start ();
|
Timer timer;
|
||||||
|
|
||||||
bool const obfuscate = context.config.getBoolean ("obfuscate");
|
bool const obfuscate = context.config.getBoolean ("obfuscate");
|
||||||
bool const print_empty_columns = context.config.getBoolean ("print.empty.columns");
|
bool const print_empty_columns = context.config.getBoolean ("print.empty.columns");
|
||||||
|
@ -287,7 +287,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
||||||
// Stop if the line limit is exceeded.
|
// Stop if the line limit is exceeded.
|
||||||
if (++_lines >= _truncate_lines && _truncate_lines != 0)
|
if (++_lines >= _truncate_lines && _truncate_lines != 0)
|
||||||
{
|
{
|
||||||
context.timer_render.stop ();
|
context.time_render_us += timer.total_us ();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
||||||
// Stop if the line limit is exceeded.
|
// Stop if the line limit is exceeded.
|
||||||
if (++_lines >= _truncate_lines && _truncate_lines != 0)
|
if (++_lines >= _truncate_lines && _truncate_lines != 0)
|
||||||
{
|
{
|
||||||
context.timer_render.stop ();
|
context.time_render_us += timer.total_us ();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,12 +383,12 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
||||||
// Stop if the row limit is exceeded.
|
// Stop if the row limit is exceeded.
|
||||||
if (++_rows >= _truncate_rows && _truncate_rows != 0)
|
if (++_rows >= _truncate_rows && _truncate_rows != 0)
|
||||||
{
|
{
|
||||||
context.timer_render.stop ();
|
context.time_render_us += timer.total_us ();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
context.timer_render.stop ();
|
context.time_render_us += timer.total_us ();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ int CmdExport::execute (std::string& output)
|
||||||
filter.subset (filtered);
|
filter.subset (filtered);
|
||||||
|
|
||||||
// Export == render.
|
// Export == render.
|
||||||
context.timer_render.start ();
|
Timer timer;
|
||||||
|
|
||||||
// Obey 'limit:N'.
|
// Obey 'limit:N'.
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
|
@ -101,7 +101,7 @@ int CmdExport::execute (std::string& output)
|
||||||
if (json_array)
|
if (json_array)
|
||||||
output += "]\n";
|
output += "]\n";
|
||||||
|
|
||||||
context.timer_render.stop ();
|
context.time_render_us += timer.total_us ();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue