Inefficient Data Structure

Context

Implementation

Affects

Efficiency

Problem

The use of HashMap<Integer, Object> is slow (mapping from an integer to an object).

Refactorings

Use Efficient Data Structure

Resolves

Efficiency

Affects

Solution

Use SparseArray instead:

SparseArray<Bitmap> bitmaps = new SparseArray<Bitmap>()

bitmaps.append(i, newBitmap);

See also:

Links

Related