Skip to content

App is very slow with many tasks #27

Closed

Description

@mattenklicker

I like the tasks app and so I have around 200 tasks. At this number the browser is stuck for several seconds in javascript hell when loading the tasks. Adding/Editing a task is also painful, every letter appears several seconds after typing. To look up tasks in a mobile device is completely impossible.

Are there any plans to improve the scalability?

Activity

  1. raimund-schluessler commented on Dec 28, 2016

    @raimund-schluessler
    Member

    This is a problem with Angular and I am not sure, if or how we can solve this. Maybe it is getting better with Angular2 but I am very unsure about this.

  2. nachoparker commented on Apr 25, 2017

    @nachoparker
    Member

    same problem here, It is getting really painful.

    I might have a look at the source to see if at least I can disable whatever JS is doing while I type.

    I do not understand why having many tasks affects the text box. I do not want any JS processing on the textbox as I type.

    Before I spend my time diving in... does anybody know the reason behind this? what processing is being done?

  3. raimund-schluessler commented on Jul 22, 2017

    @raimund-schluessler
    Member

    We might be able to solve this by switching to Vue.js.

  4. changed the title [-]tasks app is getting slower with growing number of tasks[/-] [+]App is very slow with many tasks[/+] on Jul 22, 2017
  5. nachoparker commented on Jul 25, 2017

    @nachoparker
    Member

    that would be great. It is borderline unusable. Just out of curiosity, what is the reason that it runs javascript as I type? any quick hack to disable it for the time being?

    edit: btw, congrats for the app. It's awesome and I can't live without it

  6. nachoparker commented on Aug 15, 2017

    @nachoparker
    Member

    Bump

    Please, I would like to attract attention to this. It makes the whole app borderline unusable for serious usage (many tasks).

    IMHO everything else can wait, because the basics don't work well. Repeating tasks and all the rest looks good but if you can't have a bunch of tasks... what is the point?

    Please, prioritize this. Thank you

  7. raimund-schluessler commented on Aug 15, 2017

    @raimund-schluessler
    Member

    What is "a bunch of" tasks? About how many tasks do we talk (subtasks count as separate task)?

  8. nachoparker commented on Aug 15, 2017

    @nachoparker
    Member

    hi, thanks for paying attention to this

    It has been gradually deteriorating, to the point that now I type the task, and wait 10 seconds for the text to appear.

    At this point I have 105 open tasks and 435 completed tasks. I now always delete instead of marking them as complete because I fear that will make things worse. Also, there is no simple way of cleaning up completed tasks ( I think there is a feature request with this ).

    Like I said, it does not even let me type. I don't even understand what is the point of the per key hit javascript processing that involves iterating all other tasks.

    Thanks again

    edit: I guess I could try to delete them from the database, but still the app is broken IMHO

  9. nachoparker commented on Aug 15, 2017

    @nachoparker
    Member

    Also, I would like to mention that I have 6 'calendars' or 'task lists'. I don't think that affects though

  10. raimund-schluessler commented on Aug 15, 2017

    @raimund-schluessler
    Member

    Completed tasks are not loaded after a page reload by default. They will only be loaded if you click on "Load remaining completed tasks" below the task list (or if you open their parent task). So, completed tasks are only on the server, but not in the app. This is already for performance reasons and deleting instead of completing tasks will not improve performance. In case completed tasks are loaded for you, please file an issue.

    I currently have 40 tasks in the app and it runs smoothly. There is no lag when typing into the task input bar and the task appears quasi immediately when I hit enter. Now, 40 is not 100, but I still wonder why it is so bad for you?!

    Edit: Hm, I loaded 200 completed tasks and typing now has a lag.

  11. nachoparker commented on Aug 15, 2017

    @nachoparker
    Member

    In case completed tasks are loaded for you, please file an issue.

    They are not, thanks for the info

    still wonder why it is so bad for you?!

    Probably because firefox without e10s enabled : S

    Still, does not make sense to me that there is any JS processing while you type... what is it for?

    I tried to do some basic debugging some time ago, and I found the breakpoint for the code flow when it triggers, but IIRC it was only testing for the escape code, so it didn't look like it was doing much processing.

    There's obviously something, I just didn't see it in my quick investigation

    Edit: Hm, I loaded 200 completed tasks and typing now has a lag.

    Edit: great, first step... able to reproduce!

  12. damien-rembert commented on Aug 15, 2017

    @damien-rembert

    Probably because firefox without e10s enabled : S

    Well I'm using Chrome and it's the same for me (around 150 tasks).

  13. nachoparker commented on Aug 15, 2017

    @nachoparker
    Member

    Well I'm using Chrome and it's the same for me (around 150 tasks).

    "good" to know (not really). You know FF uniprocess normally less performant in the javascript engine, so I assume it will be more noticeable in FF ;)

    @raimund-schluessler let me know how I can help

  14. raimund-schluessler commented on Aug 15, 2017

    @raimund-schluessler
    Member

    The task input is to be found here:
    https://github.com/nextcloud/tasks/blob/master/templates/main.php#L153-L156

    We do check every keystroke, because we want to react on the user pressing escape, but this should not become worse with multiple tasks. You can check though, if it helps to remove ng-keydown="checkTaskInput($event)" but I doubt that a bit.

    I assume the problem is ng-model="status.taskName" which we use to have the name of the new task. I guess we could replace that with something that only reacts when the form is submitted.

  15. nachoparker commented on Aug 15, 2017

    @nachoparker
    Member

    We do check every keystroke, because we want to react on the user pressing escape,

    Yeah, that's what I saw

    this should not become worse with multiple tasks

    That's what I thought... maybe there's some hidden magic in the angular component?

    I did try removing eventhandlers and things, but didn't work for me. Not that I tried hard to understand the code.

    I just tried again, removing the ng-keydown hook from templates/main.php and templates/part.taskbody.php and it didn't do it for me.

    This happens to me on all the text boxes: the main one to add a new task, the one to rename an existing task (it changes as you type in the list as well), and in the notes for an existing task

  16. raimund-schluessler commented on Aug 15, 2017

    @raimund-schluessler
    Member

    They all have ng-model set. See:
    https://github.com/nextcloud/tasks/blob/master/templates/part.details.php#L15
    https://github.com/nextcloud/tasks/blob/master/templates/part.taskbody.php#L50-L57

    ng-model also reacts immediately to keystrokes. You could check by removing this directive (of course adding a task will not work then anymore).

  17. nachoparker commented on Aug 20, 2017

    @nachoparker
    Member

    I tried removing both ng-keydown and ng-model from those files, and sure enough the app breaks, but still I cannot type fluidly. There is some JS triggering still

  18. nachoparker commented on Sep 5, 2017

    @nachoparker
    Member

    Hi,

    Any plans to work on this? It really makes heavy usage impossible

  19. SehLax commented on Jan 3, 2018

    @SehLax

    my firefox just showed me the "script is probably damaged" warning as it took too long typing :-D
    and pointed to

    Component.prototype.getAllSubcomponents@/apps/tasks/js/vendor/ical.js/build/ical.js?v=658ad51f51c085f1ab51904cd6db813a-7:2162:15
    get related@/apps/tasks/js/public/app.js?v=658ad51f51c085f1ab51904cd6db813a-7:4291:16
    TasksModel</TasksModel.prototype.hasNoParent@/apps/tasks/js/public/app.js?v=658ad51f51c085f1ab51904cd6db813a-7:3948:0
    TasksController/this._$scope.hasNoParent/<@/apps/tasks/js/public/app.js?v=658ad51f51c085f1ab51904cd6db813a-7:1144:12
    ng/<@/apps/tasks/js/vendor/angular/angular.min.js?v=658ad51f51c085f1ab51904cd6db813a-7:161:355
    anonymous/fn@SCRIPT0:2:1170
    N/c<@/apps/tasks/js/vendor/angular/angular.min.js?v=658ad51f51c085f1ab51904cd6db813a-7:128:157
    n.event.dispatch@/core/vendor/core.js?v=658ad51f51c085f1ab51904cd6db813a-7:3:6413
    n.event.add/r.handle@/core/vendor/core.js?v=658ad51f51c085f1ab51904cd6db813a-7:3:3223
    

    when I put a halt point there in the getAllSubComponents function of ical.js it halts a lot, with every task arriving 4 times as an object in comps

    then I realized it's being called from get completed (app.js

    and that is being called from CollectionsModel.prototype.getCount = function(collectionID, filter)
    (app.js:3567) cycling through, hmm, at least a lot of tasks, with the count of starred tasks going up slowly.
    tasks, in my case is an array of 168 task objects, and the for loop in app.js:3565 is going through all of them.

    ok, one step up, it's being called from app.js:802 this._$scope.getCollectionString = function(collectionID), which is cycling through all the collections (current, starred, today, ...)

    well, it takes some time, but why is it even being called when all the lists seem ready?
    now, putting a halt point there at app.js:804, I see it's called always when I click anywhere in the app window. well, the rest of callees is fucking minified and I don't understand shit ;-)

    screenshot_20180103_140618_tasks-app

    does that help in any way?

  20. thmo commented on Jan 8, 2018

    @thmo

    Here, the app is also slow with only a handful of tasks (8-10). Especially adding a new task is painful, as there is a delay for every keystroke.

    Reloading the page helps, though.

  21. dmp1ce commented on Aug 2, 2018

    @dmp1ce

    I am also experiencing a slowdown with many tasks. I have about 170 active tasks with probably around 1000 completed tasks. I'm using Firefox on Arch Linux.

  22. added this to the 1.0.0 milestone on Oct 23, 2018
  23. raimund-schluessler commented on Jan 25, 2019

    @raimund-schluessler
    Member

    Fixed with #194.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions