Fix filtering performance#9690
Conversation
…urator) instead of ScheduleEntryFilters Needed to make count of filter dialog lazy
✅ Feature branch deployment ready!
|
carlobeltrame
left a comment
There was a problem hiding this comment.
Any newly added print parts can no longer be filtered until the page is reloaded
carlobeltrame
left a comment
There was a problem hiding this comment.
Comparing dev and the PR deployment on my phone, the performance seems to have improved. Have not yet tested it without the previews. That could in theory be the bulk of the performance boost, who knows. Also have not yet read through all the code changes. Commit messages seem sensible so far.
BacLuc
left a comment
There was a problem hiding this comment.
Seems to work, makes it way better. Thank you very much.
We can maybe make it even better, but we can also move that to the next pr.
| methods: { | ||
| async loadRemainingPrintData() { | ||
| const periods = this.camp.periods().items | ||
| await Promise.all([ |
There was a problem hiding this comment.
why don't you start all promises at once?
| setRepairedConfig(config) { | ||
| const repaired = this.repairConfig(config) | ||
| this.cnf = repaired | ||
| if (jsonStringifyReactiveValue(config) !== jsonStringifyReactiveValue(repaired)) { |
There was a problem hiding this comment.
oh no, my hack jsonStringifyReactiveValue spreads like weed.
If it does the job
| }, | ||
| setRepairedConfig(config) { | ||
| const repaired = this.repairConfig(config) | ||
| this.cnf = repaired |
There was a problem hiding this comment.
inline repaired and use this.cnf in the condition?
Ctrl + alt + n
| } | ||
| }, | ||
| async loadEndpointData(endpoint, load = this.camp[endpoint]()._meta.load) { | ||
| await load |
There was a problem hiding this comment.
Like this you can't start all promises at once.
return load.then(() => this.loadingEndpoints[endpoint] = false).
or even better: load.catch((e) => Sentry....finally(() => this.loadingEndpoints[endpoint] = false)
But we will anyway have the failed request in sentry, maybe the finally is enough.
| this.onChange() | ||
| } | ||
| }, | ||
| async loadEndpointData(endpoint, load = this.camp[endpoint]()._meta.load) { |
There was a problem hiding this comment.
using the first paramter to compute the default of the second.
With javascript you can do fancy stuff
This PR improves perceived loading performance in dashboard/program/print views while keeping filter state and result counts consistent.
Changes
ScheduleEntryFiltersendpoint loading responsibility to parent views._meta.loadinstead of forcing reloads.repairPrintConfigtests.