Skip to content

taomin597715379/syncmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

syncmap

GoDoc Go Report Card Licenses

Introduction

Syncmap will be the traditional map and hash together, thus greatly through the map of the concurrent performance. According to incomplete testing found that this approach than the traditional way to improve the performance of twice. Users can not care about the lock problem, as in the absence of concurrent use of the same map.

Usage

Install with:

go get github.com/taomin597715379/syncmap

Example:

import(
	"fmt"
	"github.com/taomin597715379/syncmap"
)

func main() {
	s :=syncmap.New()
	s.Set(1,1)
	v,ok := s.Get(1)
	fmt.Println(v, ok) // 1, ok

	v, ok := s.Get("this key not exists now")
	fmt.Println(v, ok) // nil, false
}

Todo

  • Rich variety of API
  • Classification statistics for different types of Key
  • Optimize the hash function to further improve concurrency

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages