Opened 3 months ago

Last modified 3 months ago

#15370 new enhancement

[HaikuDepot] Load and Unload Icons On Demand

Reported by: apl-haiku Owned by: stippi
Priority: normal Milestone: Unscheduled
Component: Applications/HaikuDepot Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

A significant part of the startup process of HaikuDepot is the loading of all of the icons for the packages present in the system's repository. The runtime memory overhead of all of the icons appears to be circa 8MB.

The current approach was probably sound to start with when there were few packages, but now the quantity of packages has grown the cost of loading all of the icons is no longer trivial. A better approach would be to load the icons 'on demand' from some sort of an LRU cache.

Situations

There are two situations where packages' icons are required.

The first is in the main list of packages (either "all" or "featured"). Here the logic is controlled by the class PackageListView which is subclassing from BColumnListView (private).

The second is in the lower portion of the window where packages' details are displayed. The icon there is shown next to the name in the top left corner. The class involved here is TitleView (see PackageInfoView.cpp).

Solution

An LRU cache is used that holds a fixed number of icons; say 100 or so. Possibly the class LocalIconStore could be modified to suit this additional functionality.

If the user scrolls fast through the list of packages then the icons would not be loaded at this high speed of scrolling. If the scrolling slows so that an icon were to be visible for > 1s or so then the icon should be loaded and should be displayed once it were loaded.

For the packages' details, the icon load should be initiated as soon as the package details are displayed. Once the icon is loaded then it should be displayed.

Change History (1)

comment:1 by diver, 3 months ago

Component: - GeneralApplications/HaikuDepot
Owner: changed from nobody to stippi
Type: bugenhancement
Note: See TracTickets for help on using tickets.