Closed vhemery closed 1 year ago
Hi @vhemery
Thank you for your contribution. We have analyzed this issue and have come to several conclusions. Indeed, the UI freezes when the workload in the decompression process is high. Unfortunately this is not a javascript promises issue. In a Electron App, the UI (renderer) runs in separate process from the Main Thread, where the pipeline of the new project is executed. However, to our surprise, it seems that these processes are not as independent as they claim to be. If the main thread gets blocked, it can freeze all the rendering threads initiated by it. This post discussing the issue is very interesting: https://medium.com/actualbudget/the-horror-of-blocking-electrons-main-process-351bf11a763c.
So what we have decided is to start migrating some computationally expensive processes that were running directly on the main process to secondary threads in order to avoid blocking the main process, regardless of whether we needed concurrency or not. The decompression stage is the first one we have moved, and it is already integrated. The official release with this improvement will be available in a few days.
Nevertheless, we have plans in our backlog to improve the progress reporting and provide users with estimated times for each stage.
Once again, we appreciate your contribution as it has helped us better understand the architecture of Electron in these cases
During the "Decompressing files" stage or scanning, the UI can easily freeze. (enhancement)
Steps to reproduce with SCANOSS Audit Workbench Setup 1.4.0 (no particular version of NPM installed) :
There are two complementary ways to improve the situation.