-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Image tag sorting optimizations #2328
Comments
There is already an optimisation for the API calls that Weave Cloud uses -- but it was not followed through. See #2211, which will land in 1.14.0 shortly. This enables a new API method, If you don't think that will help, then you'll need to be more precise about where you think the inefficiency lies -- "we could do with some optimizations to the algorithm" is not much to go on. |
#2211 does look like it would help.
go test -bench=BenchmarkSort |
Your benchmark is flawed -- it runs all but the first trial on an already sorted slice. Making these changes ...
.. it's apparent that |
@cristian-radu It's possible (and a reasonable suggestion) that each sort could be made a bit more efficient. I think there's room for reducing the number of sorts undertaken -- the most efficient sort being the one you don't have to do -- so I am inclined to start looking there. |
.. and so was mine -- I should not use |
Closing this, since #2338 seems to have sorted it out. @cristian-radu is this still a problem? Please let me know. |
Describe the bug
A clear and concise description of what the bug is.
In Weave Cloud, we are seeing some issues with workload image tag information not loading during busy times.
More details on this here:
https://weavesupport.zendesk.com/agent/tickets/534
Fluxd logs show:
caller=logging.go:69 component=upstream method=ListImagesWithOptions error="getting all workloads: context deadline exceeded"
Looking at the CPU profile at the time this is happening (see ticket attachments), it would seem that we could do with some optimizations to the algorithm in order to prevent the request deadlines from being exceeded.
The text was updated successfully, but these errors were encountered: