Replace vector usage in collect_vma with map
This change updates the collect_vma callback in showmap.cpp to use a map
to accumulate VMAs instead of a vector. This is done because the
insertion function used for the -a (address) and -v (verbose) options is
expensive, and is done in O(# of VMAs) time. This improves the runtime
complexity to O(log(# of VMAs)). collect_vma_merge_by_names has been
combined with collect_vma.
This drastically improves showmap's CPU usage. Over 3 trials each:
1) showmap -a: 37% reduction in CPU cycles spent in showmap
2) showmap -v: 67% reduction "
3) showmap -a -v: 35% reduction "
Test: Check that showmap still functions as expected (with various
options); measure CPU improvements.
Bug: 229147699
Change-Id: I6d9d40189883a98f4f434ac940967561d9cf26fb
1 file changed