Remove unused data members from classes and structs used in the RTS
I recently found an unused data member (char gName256) in the TableEntry class. TableEntry is used to store group information in the Charm++ _groupTable. Apart from the unused variable, TableEntry has only a few other data members, so gName is responsible for most of the size of TableEntry objects. As _groupTable is essentially a hash table, I wondered whether the empty space is adversely affecting performance when doing searches on the hash table. I ran a test of EpiSimdemics with gName commented out, and performance did improve by about 1%.
Keeping the RTS footprint small and tidy is clearly beneficial for performance and readability. We should eliminate unused variables from anywhere inside the repository, but especially from classes and structs used to hold frequently accessed data.
The task is to:
(1) identify frequently accessed data structures in the RTS
(2) grep for the name of each data member in the corresponding classes
(3) remove unused data members and test performance
#2 Updated by Laxmikant "Sanjay" Kale over 3 years ago
We need to make sure the extra fields are not added for cache alignment. This is rare, and only happens in message envelopes etc. But for this reason, you should get this reviewed by a senior member (e.g. Phil, Nikhil, ..). Hopefully, the fieldname will tell you if this is so.