Knockout: Performance issues with survey that has many pages with visibleIf logic
See original GitHub issueAre you requesting a feature, reporting a bug or asking a question?
Bug / performance issue
What is the current behavior?
Imagine a survey with 40 pages, each having 20 questions. When the navigation mode is set to question per page mode the initial startup is very slow. Furthermore, any logic on a first page that hides one of the 40 initial pages now hides 20 pages; this magnification while expected makes it very slow very quickly.
What is the expected behavior?
While not all performance issues can be tackled easily and there will always be limits, logic handling should not block the UI. Currently what happens is a multiple choice option gets selected and the window freezes for 5+ seconds.
How would you reproduce the current behavior (if this is a bug)?
I can’t provide the original survey (since it is not mine) but will look into create a big sample.
Solution
Several solutions exist, one simple one that’ll work with a caveat is delaying evaluation of page visibileIf
until a navigation event.
This will break the live updates of the progress bar, but in these cases that could be acceptable.
Another good solution is to move these calculations to a web worker, that way it happens asynchronously without blocking the main thread.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
I will not merge this branch into master untill I finish with optimization.
@SamMousa Is it possible to get your JSON or plunker? I would love to play with it and try to optimize it. You can create a ticket in our support forum. I can make it private if needed.
Thank you, Andrew