populse / populse_mia

Multiparametric Image Analysis
Other
10 stars 9 forks source link

optimize project opening #254

Closed denisri closed 2 years ago

denisri commented 2 years ago

Expected behavior Opening a project should be fast

Actual behavior Opening a rather small project takes about 10 seconds on my laptop (with local files), which seems not reasonable and surprisingly long. For another (a bit larger) database it's more than 20 seconds, thus seems to depend on the size of the database. While developing we restart populse_mia very often, and this time is taken at each trial/test. Even for users, the use of a database is supposed to be fast and allow smooth data opening and navigation, which is not what we observe today.

denisri commented 2 years ago

Looking at the code in populse_mia.main_window in MainWindow.switch_project() and printing time at different points, I see that all the time is taken while calling problem_list = data_loader.verify_scans(temp_database). So I had a look at this function, which does the following:

This is very good for sanity checking, but is, in my opinion, totally inappropriate here.

In large databases this operation may take several weeks of IO and processing (I'm not kidding !).

I propose to make this check an option (available in a menu or via a button somewhere), because being able to perform this check is sometimes useful, but it should be done only on demand. I will bypass this step in switch_project(), at least unless a specific config option in the project says that the check should be done.

servoz commented 2 years ago

This is a good modification that will significantly improve the speed of execution of Mia! You are right this possibility of verification must exist but only on demand by clicking on File > Check the wole database.