seppo0010 / rsedis Goto Github PK
View Code? Open in Web Editor NEWRedis re-implemented in Rust.
License: BSD 2-Clause "Simplified" License
Redis re-implemented in Rust.
License: BSD 2-Clause "Simplified" License
I'm not at all familiar with the codebase, but figured it might be worth a look in case you want to consider a similar approach here.
https://youtu.be/s19G6n0UjsM
https://jon.thesquareplanet.com/crates/noria/
why so slow compared with redis?
redis 1mil read / write per second
rsedis, 25k read / write per second
I am always curious on how people do the "conversion" from one language to another?
Did you take the original source code and translated it one file after another or did you take the concepts and try to implement it or another way?
Sorry for my curious mind. Thanks.
I'm using Redis for some time series logging on a Raspberry Pi, but I just had to compile Redis 5.0 from source for Streams.
It would be great if rsedis supported Streams with a short guide to embed the same functionality in my Rust program so I can drop Redis as a custom-build dependency :).
Good luck with your project! Looks cool
Do you have any benchmark between original Redis and your implementation?
cant run cargo build
warning: unused import: libc::funcs::c95::ctype::isprint
compiling parser v0.1.0 ...... rsedis/parser
error[E0554].....
skiplist.0.2.10/src/lib.rs:26:35
Can not compile on windows for x86_64-pc-windows-msvc target with VisualStudio 2019.
... almost 50k lines ommited ...
error: aborting due to 4550 previous errors
For more information about this error, try `rustc --explain E0412`.
error: Could not compile `kernel32-sys`.
(see full cargo output build.log.msvc.txt)
kernel32-sys crate is now obsolete and should be replaced with winapi.
I am learning rust and the source code of rsedis is a good teaching material.But I found a BUG:
pub fn ltrim(&mut self, _start: i64, _stop: i64) -> Result<(), OperationError> {
let list = match *self {
ValueList::Data(ref mut list) => {
let len = list.len();
let start = match normalize_position(_start, len) {
Ok(i) => i,
Err(g) => if !g { 0 } else {
list.split_off(len);
len
},
};
let stop = match normalize_position(_stop, len) {
Ok(i) => i,
Err(g) => if !g {
list.split_off(len);
0
} else { len },
};
list.split_off(stop + 1);
list.split_off(start)
}
};
*self = ValueList::Data(list);
Ok(())
}
This is a function of the struct ValueList in database/src/list.rs.
If _stop
argument equal or greater than len
, the value of stop
will be len
and stop + 1
will out of range.
If stop
less than len
and start
greater than stop + 1
, the program will panic.
how to config memory to be used?
Outputs the following error when I run cargo run
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading skiplist v0.2.4
Downloading time v0.1.26
Downloading gcc v0.3.8
Compiling libc v0.1.8
Compiling gcc v0.3.8
Compiling response v0.1.0 (file:///Workspace/rustlang/git/rsedis)
Compiling parser v0.1.0 (file:///Workspace/rustlang/git/rsedis)
<std macros>:6:1: 6:32 error: the trait `core::convert::From<core::num::ParseFloatError>` is not implemented for the type `ParseError` [E0277]
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 6:48 note: in expansion of try!
parser/src/lib.rs:77:39: 77:66 note: expansion site
<std macros>:6:1: 6:32 error: the trait `core::convert::From<core::num::ParseFloatError>` is not implemented for the type `ParseError` [E0277]
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 6:48 note: in expansion of try!
parser/src/lib.rs:79:35: 79:57 note: expansion site
<std macros>:6:1: 6:32 error: the trait `core::convert::From<core::num::ParseFloatError>` is not implemented for the type `ParseError` [E0277]
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 6:48 note: in expansion of try!
parser/src/lib.rs:85:19: 85:41 note: expansion site
error: aborting due to 3 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `parser`.
To learn more, run the command again with --verbose.
Intentionally blank. Sorry, would have Tweeted if I knew your handle :)
As we can see, your last commit was almost 3 years ago. So, what's the plan?
Are you still working on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.