SasView / sasview

Code for the SasView application.
BSD 3-Clause "New" or "Revised" License
51 stars 41 forks source link

The P(r) inversion perspective takes extremely long on initial loading #3063

Open butlerpd opened 2 months ago

butlerpd commented 2 months ago

Describe the bug When first switching to the P(r) inversion perspective, the perspective GUI appears nearly instantly. All buttons are grayed out as they should be with no data.

Sending the first data set to the perspective however takes roughly 15 s. before anything happens. All buttons, including values for the suggested parameter value buttons become active together. From now on, sending new data updates the suggested value parameters nearly instantly.

The fact that even the Remove data button also stays grayed out, coupled with the fact that this is only on the very first data load, suggests that there is some extra initialization happening when loading the first data set?

Note that while this extra 15s exists in 5.0.6 as well, everything is nearly instantaneous in version 4.2.2. So some strange 15 second wait time seems to have been introduced between 4.2.2 and 5.0.6.

To Reproduce Steps to reproduce the behavior:

  1. load some data (e.g. apoferritin)
  2. send to Inversion (P(r)) and start a timer
  3. stop the timer once the boxes are populated
  4. Do the same in version 4.2.2

Expected behavior The speed of 4.2.2 should be regained. At the very least, if there is some new computations needed for the initial setup they should start as soon as the inversion is requested. Or perhaps in a separate thread but on startup?

SasView version (please complete the following information):

Operating system (please complete the following information):

Additional context Identified while tracking and verifying bugs reported from the NIST CNR summer school. This also may be the source of a few reports that have not been possible to reproduce that "PR does not work" or "when sending data to inversion nothing happens".

rozyczko commented 2 months ago

There is a delay (6.0.0 installer, win10) but it's about 3-4s on my machine. I'll profile the issue and see if it can be easily fixed for 6.0