I've removed redundant variable instantiations from loops, as the variables won't change from one step to another.
Some calls to CanReg "main" server have been factorized, as these calls were the main reason for the import feature being so slow.
So far, with these modifications, the import is at least twice faster if compared to the initial time.
For reference on my computer:
With a .csv file of 89 992 patients, it used to take 29m27s, now it takes 11m40s.
With a .csv file of 10 000 patients, it used to take 1m55s, now it takes 47s.
Please note these time references change depending on the workload the computer has to manage
I also edited the code so that when the user clicks on "cancel", the cursor will switch back to the "normal" state instead of keeping the "loading" state which confused me a lot when I was testing the feature.
https://github.com/infotel4iarc/CanReg5/commits/C202308-Improve_file_import
I've removed redundant variable instantiations from loops, as the variables won't change from one step to another. Some calls to CanReg "main" server have been factorized, as these calls were the main reason for the import feature being so slow.
So far, with these modifications, the import is at least twice faster if compared to the initial time. For reference on my computer:
Please note these time references change depending on the workload the computer has to manage
I also edited the code so that when the user clicks on "cancel", the cursor will switch back to the "normal" state instead of keeping the "loading" state which confused me a lot when I was testing the feature.