Investigate Data Structures in Fenix and refactor for better memory consumption
Categories
(Fenix :: General, task, P1)
Tracking
(Not tracked)
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.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
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.
Description
•