mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TDB2: Improve TF2::get(uuid, task) performance
- Improves "task import" performance test on test machine further from 13s to 1.9s. - Active only during "task import". Might be worth using during other mass lookups like "task sync", or could even be a good default.
This commit is contained in:
parent
d006a2820b
commit
4fb9307be5
2 changed files with 42 additions and 4 deletions
|
@ -28,6 +28,7 @@
|
|||
#define INCLUDED_TDB2
|
||||
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
@ -81,6 +82,12 @@ public:
|
|||
bool _has_ids;
|
||||
bool _auto_dep_scan;
|
||||
std::vector <Task> _tasks;
|
||||
|
||||
// _tasks_map was introduced mainly for speeding up "task import".
|
||||
// Iterating over all _tasks for each imported task is slow, making use of
|
||||
// appropriate data structures is fast.
|
||||
std::unordered_map <std::string, Task> _tasks_map;
|
||||
|
||||
std::vector <Task> _added_tasks;
|
||||
std::vector <Task> _modified_tasks;
|
||||
std::vector <std::string> _lines;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue