Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin is very slow to start #141

Open
adamltyson opened this issue Apr 16, 2024 · 7 comments
Open

Plugin is very slow to start #141

adamltyson opened this issue Apr 16, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@adamltyson
Copy link
Member

I will try to see if I can reproduce this on other machines, but on my Ubuntu 20.04 machine, the plugin takes a very long time to start (~20s). Other plugins start as normal.

@adamltyson adamltyson added the bug Something isn't working label Apr 16, 2024
@NicoKiaru
Copy link

Agreed. It's not horrible but a bit weird that it takes so long (tested on Win11 and on a flavor of Linux in a VM)

@adamltyson
Copy link
Member Author

This is also the same with the atlas manager widget, so not sure what's going on here.

@adamltyson
Copy link
Member Author

FYI I profiled adding the atlas manager widget. I'm none the wiser though.

brainrender-napari-profile

@alessandrofelder
Copy link
Member

alessandrofelder commented Jul 25, 2024

Thanks - what I would naively take from it is: out of the 24 seconds it takes to add the widget to napari, it takes 12 seconds each to

  • downloading and reading the text file with the latest version from GIN
  • formatting the atlas names into more readable form
    ?
    image

A possible improvement for the first part would be to cache the latest versions locally, and have a button that checks for updates remotely? So this is not done every time (GIN is not going to change daily) see #127

We could also precompute the legible name if that function is so slow?

@adamltyson
Copy link
Member Author

I'm not sure that's the problem. I think getting the latest versions takes 2ms, but it's taken a total of 12 seconds before it gets to that point.

@adamltyson
Copy link
Member Author

This returns 1.92e-05, so I don't think this function is to blame!

import timeit

start = timeit.timeit()
from brainglobe_atlasapi.list_atlases import get_all_atlases_lastversions
versions = get_all_atlases_lastversions()
end = timeit.timeit()
print(end - start)

@alessandrofelder
Copy link
Member

alessandrofelder commented Jul 25, 2024

Right, OK, that makes more sense - thanks.
IIRC my suspicion at the time was that instantiating and populating the Qt TableModel object was slow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants