imdone / imdone-atom

imdone-atom has been archived
https://imdone.io/docs
MIT License
222 stars 18 forks source link

Saving a file with lots of tasks makes Atom unresponsive #71

Closed jronallo closed 8 years ago

jronallo commented 8 years ago

I will sometimes have a single file that includes very many tasks/todos. In one file I have ~70 tasks listed. Before recent changes I could open and save this file without issue. Now when I make any change to this file Atom becomes unresponsive for a few seconds sometimes to the point of suggesting the application be closed. I believe this only surfaced in the past few days if not today. Files with fewer tasks do not lock and block Atom for so long. Is there any way I could see what's happening during the time when Atom is unresponsive?

jronallo commented 8 years ago

Another data point. Moving a task card that comes from a file with a lot of todos also makes Atom unresponsive, but it seems like for less time.

piascikj commented 8 years ago

How many tasks are in the file? You can see what's happening by opening dev-tools ctrl+shift+I and setting imdone_debug = true in the console. This will output some debug logs.

jronallo commented 8 years ago

In that one file there are 70 tasks, but I think that's not really the main issue.

From what I'm seeing when you first make a change in a directory it begins watching all the files there. So something like lazily setting up file watchers, though it does this on startup as well. That's slow, but seems to be expected.

But then files I would have expected to already be watched trigger hasNewChildren again multiple times. Attached is the repeating console log that happens right after I trigger any task change or creation. So the repetition adds to the slowness, but in my case the fix was to add some more file extensions (epub, mobi, etc.) to the .imdone/config.json exclude list. This excluded some file that were in the same directory as my text long file with lots of tasks.

In any case you may want to close or rename this issue since it is something else (repeated calls to hasNewChildren for the same files) if anything.

add-task-to-file-console-log.txt already-has-new-children-console-log.txt

piascikj commented 8 years ago

@jronallo Just want to let you know I'm working on this over the weekend.

piascikj commented 8 years ago

@jronallo I made some changes to the file watching code, but I think the real issue is the number of files in the directory of the changed file. Let me know how the update works. I'm still working on this one though. I want to reduce the redundancy as much as possible.

piascikj commented 8 years ago

@jronallo How is this working for you now?

jronallo commented 8 years ago

I'm still experiencing some slowness and UI locking when saving a file. I know this is probably because I have so many files, but it is making my use case unworkable. Previous versions of the file watching I did not have any issues.

piascikj commented 8 years ago

I had problems over the weekend as well. What I decided to do is go back to the previous file watcher and create a setting to use the alternate. I'll have it released in a few minutes.

piascikj commented 8 years ago

Just released 1.3.25 with the chokidar file watcher and the atom native alternate. Let me know if that works for you.

jronallo commented 8 years ago

@piascikj So far this is working well. Thank you!

piascikj commented 8 years ago

No problem. Sorry for the inconvenience.