Comments (2)
That’s correct. Map does not have built in locks.
from btree.
I had a database lock wrapper implementation for standard Go maps which was about 600ns/op for random in-memory reads, but using btree.Map seemed to have worse performance over the standard implementation in my test scenario which is why I thought maybe I was putting locks over locks.
Since then I have moved over to using a custom implementation of sync.Map (thus removing my lock wrapper, down to 400ns/op random in-memory reads,) but I'm not sure if the techniques used (one dirty store, one read-only store) would be efficient or applicable for btree structure in order to create a potentially faster "btree.SyncMap". Not asking for an implementation, nor am I committing to contributing one, but it's a curious idea.
In any case, thanks for this library and the quick support.
from btree.
Related Issues (20)
- Generics HOT 8
- ADMIN
- The Map[K, V].find() API design discussion HOT 4
- With go1.18rc1 getting error: constraints: package constraints is not in GOROOT HOT 10
- Seek does not initialize iter item HOT 4
- MapIter[K,V] Seek method does not initialize the item HOT 2
- Documentation for Get() is inaccurate
- Use of interface{} and constant type/length keys
- Breaking changes in switching from uint64 to atomic.Uint64 HOT 1
- Investigate if we can re-use allocated memory after `Map.Clear()` HOT 1
- How does copy-on-write actually work?
- Map for pre-generics version of Go
- possible panic when writing from multiple goroutines HOT 1
- is b+ tree surport? HOT 5
- add put method to set kvpairs , if old value exists, return val
- Do we need a rebalancing process for the btree? HOT 2
- question about crash during iteration (probably because of mutation during iteration) HOT 2
- PathHint on Map/Set?
- Delete during Ascend in thread-safe tree HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btree.