taskwarrior-tui icon indicating copy to clipboard operation
taskwarrior-tui copied to clipboard

Taskwarrior TUI exceptionally slow when $TASK_DATA_HOME is not set

Open martin-braun opened this issue 2 years ago • 12 comments

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)

martin-braun avatar Jan 16 '24 19:01 martin-braun

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 avatar Jan 16 '24 19:01 kdheepak

@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.

martin-braun avatar Jan 16 '24 19:01 martin-braun

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 avatar Jan 16 '24 19:01 kdheepak

@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. :)

martin-braun avatar Jan 16 '24 20:01 martin-braun

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!

kdheepak avatar Jan 16 '24 20:01 kdheepak

I did a kind of drive-by reverse reproduce test.

  • I was previously at default values (ie. no TASKRC or TASK_DATA_HOME).
  • I moved my data by first setting TASK_DATA_HOME and 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

GregPK avatar Jan 29 '24 09:01 GregPK

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.

kdheepak avatar Jan 29 '24 10:01 kdheepak

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?

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

martin-braun avatar Jan 30 '24 08:01 martin-braun

Thanks for sharing the versions!

kdheepak avatar Jan 30 '24 09:01 kdheepak

yes

DC-Melo avatar Mar 21 '24 11:03 DC-Melo