question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Knockout: Performance issues with survey that has many pages with visibleIf logic

See original GitHub issue

Are 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:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Oct 28, 2021

I will not merge this branch into master untill I finish with optimization.

1reaction
andrewtelnovcommented, Oct 27, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Patient Medical History, Survey Creator Example - SurveyJS
Patient Past Medical, Social & Family History Survey, Online Survey Builder Example.
Read more >
Advanced Survey/Feedback/Quiz System - SurveyJS
Share data between questions. Print to PDF. Analyze survey results. Supports condition logic. Markdown and Text Processing. Multiple languages.
Read more >
survey-knockout - npm
Main Features · A lot of question types with a lot of built-in functionalities. · Multiple Pages Support · Dynamically change survey logic...
Read more >
survey-knockout - UNPKG
The CDN for survey-knockout. ... 2037, visibleIf: (obj: any) => boolean; ... contains information about the survey, Pages, Questions, flow logic and etc....
Read more >
Whats New - SurveyJS - AzureWebSites.net
survey -library, Bug, Ranking items with long text values are displayed ... is very slow to load, and when some logic (visibleIf) is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found