Comments (4)
I think for entries , we can keep using map because :
- Insertion on map would take O(1) and slice would take O(n)
- Getting data on map would take O(1) and slice would take O(n)
So for performance, I think it would be good if we keep using map data structure instead ofslice
from bcache.
So for performance, I think it would be good if we keep using map data structure instead ofslice
Please note that this is more about encoding performance.
Insertion on map would take O(1) and slice would take O(n)
hmm..yes, insertion operation performance will affect.
do you have any data that map is faster than slice?
Getting data on map would take O(1) and slice would take O(n)
we can exclude this, there is no get
operation on the message
from bcache.
we can exclude this, there is no get operation on the message
Oh my bad
hmm..yes, insertion operation performance will affect.
do you have any data that map is faster than slice?
Since someone already did benchmark on map vs slice in this ref : https://shakedos.com/maps-vs-slices-vs-arrays, I revoked my statement. For insertion, slice is faster than map.
So I agree for changing from map to slice
from bcache.
did some profiling, with this scenario:
- 40 concurrent key set, with 4K of total keys
- sleep for 2 seconds
- 40 concurrent key get, with 4K of total keys
- repeat forever
max keys is 100K.
There is no sign of issue in message.Encode performance.
So, i think we don't need optimization on this thing, at least for now.
from bcache.
Related Issues (12)
- add cache filling mechanism
- add automatic peer ID assignment
- add credits
- add cache value version
- provide benchmark data
- Add support for deleting keys HOT 6
- Delete key in underlying cache when calling Delete API HOT 6
- integration test: concurrent map iteration and map write
- Can support list ? HOT 3
- BCache + Linux Kernel 5.12 broken HOT 3
- Scaling limits and full examples? HOT 2
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 bcache.