Skip to content

More efficient data structure for favorites #2026

@traeok

Description

@traeok

Is your feature request related to a problem? Please describe.

Related to favorites management (add/removing favorites for Data Sets, Jobs and USS section)

Describe the solution you'd like

Change method of storing favorites such that the nodes can be mapped 1:1; this should shorten lookup time for corresponding nodes and make logic more straightforward for adding/removing favorites. Since we are searching based on labels, we could assign the node labels as keys for a map-based structure.

The findFavoritedNode and findNonFavoritedNode functions are marked deprecated, but they're being used in the codebase. Refactor w/ the map-based structure (as suggested above), or keep the same structures and remove the deprecation warnings?

Additional context

  • Searching through the favorites list is worst-case linear time, as well as removing a favorite - while searching/removing favorites isn't done on a constant/frequent basis, changing to a map-based structure will allow look-up time and removal time to be constant-time operations.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpriority-mediumNot functioning - next quarter if capacity permitsv3

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions