Releases: mootable/hashmap
Releases · mootable/hashmap
Dependencies
Bumped Version
- Updated Dependencies, including rollup
Privates
- Made CreateContainer properly private (programmatically)
- Finished Documenting the base HashMap
- Removed comments and docs from the browser dist files.
Documentation
Corrected some documentation, and added some better examples.
Badges
Added Badges
Documentation.js
- Removed JSDoc which had an underlying dependancy (underscore) which had a security vulnerability, as it is a dev dependancy, there is no additional risk to projects that depend on @mootable/hashmap.
- Replaced with Documentation.js
- Built a Mootable theme.
- Fixed up a load of the ReadMe and Documentation pages.
Emplace Proposal Match
- Added overrides for every() as it fails fast and being able to search in reverse maybe optimal.
- Made equalsFor and equalsAndHash methods on the hashmap using Object.defineProperty(), in preparation for typed maps.
- made emplace match the proposal more closely, by not using insert to update.
- removed jshint and replaced with eslint as the linting tool.
- More Documentation
- More Examples
- Removed unneeded node environment variables for testing.
- moved common support code into its own file.
Prototype Security Fix
- More Documentation
- Fixed usage of obj.hasOwnProperty('blah') to be Object.prototype.hasOwnProperty.call(obj,'blah')
- this could be a potential security vulnerability. So please update.
Productionized
- Breaking Changes
- Functionality
- HashMap & LinkedHashMap
- Iterators
- Added entries() iterator
- Added entriesRight() reverse of entries() iterator
- Added keys() iterator
- Added keysRight() reverse of keys() iterator
- Added values() iterator
- Added valuesRight() reverse of values() iterator
- Emplace
- added emplace() method as per the proposed map spec
- Get
- added keyOf() which retrieves the key for a provided value.
- added optionalKeyOf() which retrieves the key for a provided value, and wraps it in an option.
- Higher Order Functions
- Added reduce() similar to the array method
- Added reduceRight() similar to the array method
- Added some() similar to the array method
- Added every() similar to the array method
- Added keyOf() similar to the array method indexOf
- Added lastKeyOf() similar to the array method indexOf
- Added find() similar to the array method
- Added findLast() find in the opposite directory
- Added findKey() similar to the array method findIndex
- Added findLastKey() findKey in the opposite directory
- Added optionalKeyOf() an optional varient
- Added optionalLastKeyOf() an optional varient
- Added optionalFind() an optional varient
- Added optionalFindLast() an optional varient
- Added optionalFindKey() an optional varient
- Added optionalFindLastKey() an optional varient
- Parameters
- length and size are now both derived.
- Iterators
- LinkedHashMap only
- Set
- Added setLeft() to add to the head of the map, overwrites don't move
- Added push() to add to the tail of the map, forces a move on overwrite, to the tail.
- Added unshift() to add to the head of the map, forces a move on overwrite, to the head.
- Emplace
- Added emplaceLeft() to add to the head of the map, overwrites don't move
- Added pushEmplace() to add to the tail of the map, forces a move on overwrite, to the tail.
- Added unshiftEmplace() to add to the head of the map, forces a move on overwrite, to the head.
- Get
- added tail() which retrieves the value at the end of the map.
- added head() which retrieves the value at the start of the map.
- added tailKey() which retrieves the key at the end of the map.
- added headKey() which retrieves the key at the start of the map.
- added optionalTail() which retrieves the value at the end of the map. and wraps it in an Option
- added optionalHead() which retrieves the value at the start of the map. and wraps it in an Option
- added optionalTailKey() which retrieves the key at the end of the map. and wraps it in an Option
- added optionalHeadKey() which retrieves the key at the start of the map. and wraps it in an Option
- Delete
- added shift() to remove the first element on the map. This is a very fast method.
- added pop() to remove the last element on the map. This is a very fast method.
- Reverse
- Added reverse() method, this modifies the map, and reverses the order of its elements.
- Set
- MapIterator & SetIterator the higher order wrappers, have gone.
- They will be back at some point, but I want to focus on releasing hashmap and linkedhashmap first. I have migrated most functions to hashmap and linkedhashmap and there are plenty of libraries such as lodash that give similar functionality.
- HashMap & LinkedHashMap
- Testing
- 100% Code Coverage on Everything.
- Some minor defects fixed as part of the process, these will improve performance.
HAMT
- Functionality
- Breaking changes
- option to fine tune hashmap has been removed, as we can massively improve performance, by removing it.
- Introduced proper HAMT layers above the bottom the layer. This means we will get optimal performance, with only a small memory sacrifice for small maps.
- Put back in the Containers at lower levels, but shift them a level now rather than copy them, if a collision occurs.
- Improved performance of hashcode and equals, by recombining them.
- uncovered a type collision bug when using option (fixed)
- Removed entry class, and replaced with an array of length 2.
- Moved container class into the hashmap implementation, and removed hashcontainer.
- introduced a new linkedcontainer for linkedhashmaps
- added reverse iterators for all maps.
- Breaking changes
- Testing
- Removed or migrated old tests.
- created tests for new equalsHashCode methos.
- Benchmarks
- improved output graph and code of benchmarks.
- tried to improve certainty of executions on the benchmark
- this has some issues as map at 4 million entries grinds to a halt if I try to prestress it.
- recollecting memory to be reported on in a later version.
Graphing the Bench
- Breaking Changes
- Switched to an options parameter for all methods.
- Internal classes have been restructured.
- Switched to using Benny, for cleaner benchmarking.
- Cleaned up benchmarking, and included optional parameters.
- Added Graph for better comparison.
- Simplified code, ready for optimisation phase later on.
- Fixed some potential bugs around keys being overwritten when branching.
- Allowed arrays to resize themselves rather than provide a set size.
- Started work on the emplace method.