Open Bug 1926662 Opened 1 year ago Updated 1 year ago

Instrument nsTArray to help with optimization

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

People

(Reporter: jesup, Unassigned)

Details

We should consider modifying nsTArray to record in a hashtable keyed by file/line# containing:
a) how many are created,
b) how many exist at once (optional),
c) max size distribution (or at least average size) (note, not destruction size)

Then dump the hashtable at shutdown.
This can be used for finding 'hot' nsTArrays, and also good sizes for AutoTArrays or initial array sizes/SetCapacity to reduce allocation traffic.

This could be optionally compiled in as needed once in a while to run a check. (#ifdef TARRAY_STATS)

Blocks: 1927021
No longer blocks: 1927021
You need to log in before you can comment on or make changes to this bug.