tidwall / resp Goto Github PK
View Code? Open in Web Editor NEWReader, Writer, and Server implementation for the Redis RESP Protocol.
License: MIT License
Reader, Writer, and Server implementation for the Redis RESP Protocol.
License: MIT License
Nice work @tidwall :)!
Resp will be shared in our next RedisWeekly! Once published (in a matter of minutes) you will be able to see your projet description here :)
Even with empty handlers that basically NOOP the performance of this library is still lacking compared to Redis itself which is doing more work. I wonder if the bottleneck could be removed? I haven't looked into it yet but I thought I would report some benchmarks.
Redis
./redis-benchmark -t set -n 100000 -q -P 100
SET: 806451.62 requests per second
Resp
./redis-benchmark -t set -n 100000 -q -P 100
SET: 214638.34 requests per second
Server code is as follows.
func startRedis() {
s := resp.NewServer()
s.HandleFunc("set", func(conn *resp.Conn, args []resp.Value) bool {
if len(args) != 3 {
conn.WriteError(errors.New("ERR wrong number of arguments for 'set' command"))
} else {
conn.WriteSimpleString("OK")
}
return true
})
if err := s.ListenAndServe(":6379"); err != nil {
log.Fatal(err)
}
}
hi Josh, I'm glad to see the code you wrote. I found some places in the code that were not clear enough to consult you
1、
aof Can we create reader
in OpenAOF function?
2、
AppendMulti
need Seek to the end of the file. Can we call the seek function directly?
3、
readValue
The readValue function returns errProtocol, why does it need a & sign?
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.