Task scheduler for internal operations
Certain back-end operations take up significant time to execute which affects user experience (reference: https://github.com/limetech/webgui/pull/290#issuecomment-372228431).
Perhaps there can to be an internal task scheduler for certain operations that happen without the user requesting them during page load time? That way webGui could consume recent updates instead of being the initiator for their generation.
Caching mechanism in Docker container list information was broken, fixed in 6.5.1. On my system that cuts loading time in half (e.g. Dashboard takes 220ms to load 10 containers + 3 VMs)
@bergware, when $display is set to docker at https://github.com/limetech/webgui/blob/a3fe701dfe0c44969f0fbc67594d47be6fbcc081/plugins/dynamix/include/DashboardApps.php#L20
still takes about ~1500ms to load the script when there is 32 container instances.
These are my test results for complete loading + rendering of containers in Dashboard:
10 containers = 205 ms 20 containers = 562 ms 30 containers = 788 ms 40 containers = 1074 ms
1000+ms seems like an unreasonable amount of time. Portainer takes 80-100ms for 33 containers.
You can not expect a interpreted PHP script to perform at the same level as a compiled binary executable.
Fixing the caching issue gave already a great boost in performance, I don't see further optimizations, but if you see/have solutions to improve even more, please raise a PR and I am happy to test.
@bergware, expecting lower difference between both. Have not inspected DockerClient in detail, but the information ca be flushed as soon it gets available, similarly to how logging.htm works. If implemented asynchronously, the results could get inserted in the DOM as soon as they become available in the JSON/XML response. This will improve page responsiveness, but perhaps there are back-end elements that could be improved. Happy to do a more detailed benchmark in the near future.