Speed up top_n by ~30-50%
Speed up top_n by ~30-50%

the performance improvement depends on the number of stats as well
as their distribution but is faster in all cases.

top_n is not a primary bottleneck compared to object_list and
the code being profiled itself but can still account for 10-20%
of the total time.

dgynn/memory_profiler,SamSaffron/memory_profiler