adrianstone55 / SymbolSort

A Utility for Measuring C++ Code Bloat
http://gameangst.com/?p=320
Apache License 2.0
117 stars 17 forks source link

Symbol names in reports should be sorted #7

Closed randomascii closed 7 years ago

randomascii commented 7 years ago

A useful technique for monitoring regressions is to created symbolsort reports and then textually compare them. However symbolsort doesn't have a consistent way of breaking ties in the Sorted by Size section. In a a recent pair of reports on Chrome this led to these two series of globals in the list of symbols:

   32768         data  gDigits                                                                                                                   
   32768         data  nacl_user                                                                                                                 
   32768         data  gInvSqrtTable                                                                                                             
   32768         data  nacl_thread_ids                                                                                                           

and:

   32768         data  nacl_thread_ids                                                                                                           
   32768         data  nacl_user                                                                                                                 
   32768         data  gInvSqrtTable                                                                                                             
   32768         data  gDigits                                                                                                                   

The only difference is that the first and last globals are swapped. Using symbol name as a tie-breaker would avoid this problem. I'll probably put together a PR for this later. A couple of swaps is not a problem but on Chrome reports there are typically hundreds.