-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a simpler representation for NodeMap with only one value
A HashMap with only one item uses lots of memory since the hash table has room for 16 items, and each actually used item in the array is a linked list node. Collections.singletonMap gets rid of this overhead, but still uses memory for caching keySet, entrySet and values collection view instances. Reduces BasicElementView memory use from 429706 to 378338 bytes and the memory use in BeverageBuddy with an edit dialog open from 262257 to 230435 bytes.
- Loading branch information
Showing
2 changed files
with
158 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters