Closed
Bug 1510664
Opened 6 years ago
Closed 3 years ago
Performance Warning: HashMap can be replaced with SparseArray
Categories
(GeckoView :: General, enhancement, P5)
Tracking
(firefox93 fixed)
RESOLVED
FIXED
93 Branch
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: fluffyemily, Assigned: elizabbennet)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
For maps where the keys are of type integer, it's typically more efficient to use the Android SparseArray API. This check identifies scenarios where you might want to consider using SparseArray instead of HashMap for better performance.
This is particularly useful when the value types are primitives like ints, where you can use SparseIntArray and avoid auto-boxing the values from int to Integer.
If you need to construct a HashMap because you need to call an API outside of your control which requires a Map, you can suppress this warning using for example the @SuppressLint annotation.
Affected Classes:
GeckoSurfaceTexure
Updated•6 years ago
|
Updated•6 years ago
|
Product: Firefox for Android → GeckoView
This PR replaces HashMap
with SparseArray
from the Android API to
improve memory efficiency and performance.
Updated•3 years ago
|
Assignee: nobody → elizabbennet
Status: NEW → ASSIGNED
Updated•3 years ago
|
Attachment #9234145 -
Attachment description: Bug 1510664 - Replace `HashMap` with `SparseArray` in class GeckoSurfaceTexture → Bug 1510664 - Replace `HashMap` with `SparseArray`
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d86e37de9470
Replace `HashMap` with `SparseArray` r=agi
Comment 3•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox93:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•