Closed Bug 1804862 Opened 2 years ago Closed 2 years ago

Investigate Data Structures in Fenix and refactor for better memory consumption

Categories

(Fenix :: General, task, P1)

All
Android

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: kaya, Assigned: kaya)

References

(Blocks 1 open bug)

Details

(Whiteboard: [geckoview:m110] [geckoview:m111])

Our lint tool warns about several enhancement for the use of data structures such as "using SparseArray instead of Maps". In addition to that Maps can be replaced by ArrayMaps under certain circumstances and usecases. These include how frequent a data is retrieved and how big the data that the map holds. Considering these constraints, several maps can be replaced by ArrayMaps for better memory space.
It is a "small but worth to refactor" point to be considered.

Whiteboard: [geckoview:m110]
Priority: P1 → P2
Severity: -- → N/A
Priority: P2 → P1
Whiteboard: [geckoview:m110] → [geckoview:m110] [geckoview:m111]
Rank: 110

After scanning through the codebase, it looks like there is no "small but worth to refactor" point to be considered. The lint tool we use in the automation process detects the "<issue id="UseSparseArrays" severity="informational" /> <!-- hurts developer convenience of kotlin Map... -->" which favors the performance and memory. Other than that, arraylists and maps in the app are observed, and I can conclude that there is no particular usecase I was able to spot where we could refactor a data structure with a small workaround resulting in a big effect in terms of memory optimization. The parameters considered along this inspection are: "the number of read/write operations on that data structure", "the number of items stored in that data structure", "the types of key/value pairs in the data structure.". The bytecode decompilation is used in the inspection process to check the memory space for each item inside the data structure to see the potential effect of a refactoring with numbers.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.