mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-02 05:30:23 +02:00
Performance
- Added Timer class to display high resolution timing information. - Found terrible bug in Table::optimize that was taking up 99.7%, on average, of the Table::rendering time, including sorting. This fix naturally causes a 187-fold speedup of rendering. - Changed report.cpp in handleCustomReport to only load pending tasks, instead of all pending tasks. Subtle, but important difference.
This commit is contained in:
parent
4fa4c5f532
commit
0362b41f3b
11 changed files with 765 additions and 20 deletions
|
@ -48,6 +48,7 @@ my $description = 'This is a medium-sized description with no special characters
|
|||
|
||||
# Start the clock.
|
||||
my $start = time ();
|
||||
my $cursor = $start;
|
||||
diag ("start=$start");
|
||||
|
||||
# Make a mess.
|
||||
|
@ -59,23 +60,29 @@ for my $i (1 .. 1000)
|
|||
|
||||
qx{../task rc:bench.rc add project:$project priority:$priority +$tag $i $description};
|
||||
}
|
||||
diag ("1000 tasks added");
|
||||
diag ("1000 tasks added in " . (time () - $cursor) . " seconds");
|
||||
$cursor = time ();
|
||||
|
||||
qx{../task rc:bench.rc /with/WITH/} for 1 .. 200;
|
||||
qx{../task rc:bench.rc done $_} for 201 .. 400;
|
||||
qx{../task rc:bench.rc start $_} for 401 .. 600;
|
||||
diag ("600 tasks altered");
|
||||
diag ("600 tasks altered in " . (time () - $cursor) . " seconds");
|
||||
$cursor = time ();
|
||||
|
||||
# Report it all.
|
||||
qx{../task rc:bench.rc ls};
|
||||
qx{../task rc:bench.rc list};
|
||||
qx{../task rc:bench.rc list priority:H};
|
||||
qx{../task rc:bench.rc list +tag};
|
||||
qx{../task rc:bench.rc list project_A};
|
||||
qx{../task rc:bench.rc long};
|
||||
qx{../task rc:bench.rc completed};
|
||||
qx{../task rc:bench.rc history};
|
||||
qx{../task rc:bench.rc ghistory};
|
||||
# Report it all. Note that all Timer information is displayed.
|
||||
|
||||
for (1 .. 100)
|
||||
{
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc ls});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc list});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc list priority:H});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc list +tag});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc list project_A});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc long});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc completed});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc history});
|
||||
diag (grep {/^Timer /} qx{../task rc:bench.rc ghistory});
|
||||
}
|
||||
|
||||
# Stop the clock.
|
||||
my $stop = time ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue