GothenburgBitFactory / taskchampion

Personal task-tracking library
MIT License
84 stars 22 forks source link

Replace working set more efficiently #414

Open djmitche opened 4 months ago

djmitche commented 4 months ago

When renumbering tasks, we delete and re-add the entire working set:

https://github.com/GothenburgBitFactory/taskchampion/blob/e725a38c991dd32fd5f3b9b2daa4644b7dbbc9d2/taskchampion/src/taskdb/working_set.rs#L38-L42

This is pretty slow, and in most cases only a few tasks will change numbers. Optimize for that case, by only updating the items that have changed. This should allow removing the Storage::clear_working_set method as well.

koleesch commented 4 months ago

I would like to do it, but i don't understand the datastructures. So I need help for it.

djmitche commented 4 months ago

Maybe we can come back to this after #410?