Taskwarrior TUI exceptionally slow when $TASK_DATA_HOME is not set
Describe the bug
task can handle TASK_DATA_HOME being unset, it just defaults to $HOME/.task at runtime. taskwarrior-tui has problems with this, the application gets exceptionally slow.
To Reproduce
Use defaults everywhere (default .taskrc, no modified .zshrc or .bashrc) and run taskwarrior-tui.
MacBook Pro 16" 2019 T2 macOS Ventura 13.5.2 (22G91)
Hmm that's unusual since TASK_DATA_HOME is not used at all by taskwarrior-tui.
Can you elaborate on what you mean by it is exceptionally slow? Which version of taskwarrior-tui are you using?
@kdheepak taskwarrior-tui 0.25.4
It might be a cascading issue. Exceptionally slow in terms of rendering. I would hit j and k and having to wait seconds until the marker moves. Or pressing a and starting typing and everything would have a huge delay, including letters appearing. C-c or q would also lag. Actions get stuck in a chain, so the more you input, the longer you have to wait.
With the TASK_DATA_HOME in .zshrc everything gets snappy again. I have no other explanation for it, other than that I have tested this to be able to come to this conclusion. Please try to replicate.
Interesting. Thanks for reporting! I don't have TASK_DATA_HOME set and I don't see any lag. I also set it and still didn't see lag. Do you have a lot of tasks? I could imagine that being a problem.
I have some ideas for generally improving the snappiness, but that will only happen as part of the refactor, tracking issue here: https://github.com/kdheepak/taskwarrior-tui/issues/349. I'll look into this specifically as I'm working on that.
@kdheepak I have only 30ish tasks. I also tested after removing my task database. It was faster, but still significantly slower than usual.
If you cannot replicate this on a Mac, then I guess it's something on my setup interfering, but I have no idea why and how. I'm in the process of overworking my dot files, cleaning things up and re-organizing.
I removed TASK_DATA_HOME and things went downhill. I was testing in multiple terminals, with and without tmux, no other TASK_DATA_HOME in my dot files somewhere.
Feel free to close this issue if nobody else can confirm it and you can't figure it out either. I got around this problem by specifying TASK_DATA_HOME to its default value $HOME/.task again and I won't touch this anymore, so I can live in peace.
I just felt the need to report it anyways. I also want to use this opportunity to thank you for taskwarrior-tui, it's great. :)
Thanks for reporting! I'll leave the issue open so that I can investigate later when I get the chance! Hope you enjoy using taskwarrior-tui. Feel free to report bugs / make feature requests if you come across anything!
I did a kind of drive-by reverse reproduce test.
- I was previously at default values (ie. no
TASKRCorTASK_DATA_HOME). - I moved my data by first setting
TASK_DATA_HOMEand I saw no change in performance (ie. no speed up). - Then I set
TASKRC(and moved it) with the data directory changed in the file. Also no changes in performance.
So I was NOT able to reproduce on
taskwarrior-tui 0.25.4
task 2.6.2
uname: Linux 6.7.0-arch3-1 #1 SMP PREEMPT_DYNAMIC Sat, 13 Jan 2024 14:37:14 +0000 x86_64 GNU/Linux
Thanks for checking! I also checked locally and didn't see any issue on my end, but clearly the @martin-braun is experiencing something.
If I have to guess, I bet it is something to with the version of taskwarrior and possibly how taskwarrior-tui is reading task details? Anyway, I have ideas for how to improve this so I'll revisit this during the (long pending) rewrite.
If I have to guess, I bet it is something to with the version of
taskwarriorand possibly howtaskwarrior-tuiis reading task details?
Just for the record:
~ > command task --version
2.6.2
~ > command taskwarrior-tui --version
taskwarrior-tui 0.25.4
~ > uname -a
Darwin mbpt2-macos.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64
Thanks for sharing the versions!
yes