Comments (4)
Perhaps the most important part missing in being production-ready is an intention to support the project in the future. If someone reports an issue with this project, and we don't believe actually fixing it would improve the project in the direction of being a learning resource, it might just turn into another one of those comments you mentioned.
As for your lru frame, it seems like the parsing spends the majority of the time inside a call to Bytes::copy_from_slice
.
from mini-redis.
Looking at the code,
Line 148 in b552f53
from mini-redis.
You would have to change several other parts of the codebase to elide that copy if it's possible at all.
from mini-redis.
I try to make the parsing code without copy:
https://github.com/photoszzt/cache_server/blob/522a2fc3fcb8ba57fd7e24a7505b41cd60a0321e/src/frame.rs#L274-L332
I change the parse in connections.rs to https://github.com/photoszzt/cache_server/blob/522a2fc3fcb8ba57fd7e24a7505b41cd60a0321e/src/connection.rs#L102-L132
My modified version records the start and end position in the slice and uses split_to and freeze to get Bytes from BytesMut.
But I find that this modification is leaking memory. I'm running a workload that inserts key/value and deletes them. The one that uses copy_from_slice doesn't leak memory. Is there anything wrong on this modification?
from mini-redis.
Related Issues (20)
- The `chat` example is empty HOT 2
- Potential bug in read_frame if we receive 2 frames ready in the buffer? HOT 1
- Benches for mini-redis HOT 2
- why is `frame` serialized to string should be removed the first element?
- Using BTreeSet instead of BTreemap HOT 1
- The `Frame::Integer` should be signed 64-bit integer HOT 2
- panic in VSCode terminal HOT 1
- Fails when install mini-redis with the latest rustc version HOT 1
- theoretically bug in db.set method? HOT 2
- Race condition in Drop of Db
- Any plan to support raft to make mini-redis become a distributed system? HOT 2
- The server test key_value_timeout has a race condition causing hang HOT 4
- why so slow compared with redis? HOT 10
- how to config memory to be used? HOT 3
- Confusing use of `notify` HOT 4
- updates? HOT 6
- Question: `shutdown_complete_rx` never used in the `Listner` HOT 2
- Fails with Latest Rust HOT 1
- bug in implementation of display for frame
- Add (optional) OpenTelemetry + Xray integration HOT 1
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 mini-redis.