Skip to content

Releases: cornelk/hashmap

v1.0.8 hashing improvements

03 Sep 00:31
Compare
Choose a tag to compare
  • improved hashing and avoid dedicated MapString type

v1.0.7 hashing improvements

31 Aug 15:27
Compare
Choose a tag to compare
  • optimized hashing by separating string support into separate type
  • removed all external dependencies

v1.0.6 hashing improvements

30 Aug 15:01
Compare
Choose a tag to compare
  • optimize hashing by Inlining hashing as anonymous functions
  • reduce allocations for write operations

v1.0.5 hashing improvements and fix

28 Aug 22:14
Compare
Choose a tag to compare
  • fix hashing on ARM CPUs
  • optimize hashing by using specialized xxhash implementations
  • reduce variable allocations in get functions
  • removed obsolete 0 length checks

It is noticeable faster than the current version of HaxMap is able to handle collisions of valid 0 hash values:

BenchmarkReadHashMapUint-8                	 1314156	       955.6 ns/op
BenchmarkReadHaxMapUint-8                 	  872134	      1316 ns/op (can not handle hash 0 collisions)
// works for this library, fails for HaxMap
func TestHash0Collision(t *testing.T) {
	m := New[string, int]()
	staticHasher := func(key string) uintptr {
		return 0
	}
	m.SetHasher(staticHasher)
	m.Set("1", 1)
	m.Set("2", 2)
	_, ok := m.Get("1")
	if !ok {
		t.Error("1 not found")
	}
	_, ok = m.Get("2")
	if !ok {
		t.Error("2 not found")
	}
}

v1.0.4 concurrent insert bug fixes

10 Aug 05:46
Compare
Choose a tag to compare
  • fixed insert during map grow
  • fixed add not working properly during concurrent delete
  • add SetHasher function to allow setting of a custom hasher
  • benchmarks have been moved to a subdirectory to remove imports for external libraries from main module

v1.0.3 Generics version improvements

09 Aug 16:55
Compare
Choose a tag to compare
  • CAS has been removed as it is not working
  • Iter function signature has been changed to Range
  • all comparable key types are supported now

v1.0.2 Generics version

09 Aug 05:15
Compare
Choose a tag to compare
  • fix hash collision handling
  • switch library to use generics
  • minor API changes
  • CAS is currently not supported
  • removed []byte key support

v1.0.1: Merge pull request #41 from tigrato/delhashedkey

11 Oct 10:41
4c85270
Compare
Choose a tag to compare
  • Fixed delete action when using hashed key
  • Fixed race condition in list