-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This has huge benefits to memory usage and performance in this case. It's still a simple implementation (probably simpler than the old one), but it drastically reduces the number of objects that need to be allocated to store a single object in the hash map. Each "bucket" in the hash map is now just a struct with a key and a value. Previously, every bucket would be an assoclist, which is an arraylist. The initial size of an arraylist is 16 elements, so every bucket would require allocating a 16-element array, an arraylist struct, and an array of length 2 to store the key-value pair for the assoclist.
- Loading branch information
Showing
1 changed file
with
55 additions
and
40 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