Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.2 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.2 KB

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