mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-30 15:45:51 +02:00
updated README.md
This commit is contained in:
parent
6977edc032
commit
e5e2b9095c
25
README.md
25
README.md
@ -5,7 +5,7 @@ Extremely efficient object serialization library. It's like JSON, but very fast
|
||||
|
||||
## What's MessagePack?
|
||||
|
||||
MessagePack is a binary-based efficient object serialization library. It enables to exchange structured objects between many languages like JSON. But unlike JSON, it is very fast and small.
|
||||
**MessagePack** is a binary-based efficient object serialization library. It enables to exchange structured objects between many languages like JSON. But unlike JSON, it is very fast and small.
|
||||
|
||||
Typical small integer (like flags or error code) is saved only in 1 byte, and typical short string only needs 1 byte except the length of the string itself. \[1,2,3\] (3 elements array) is serialized in 4 bytes using MessagePack as follows:
|
||||
|
||||
@ -13,13 +13,19 @@ Typical small integer (like flags or error code) is saved only in 1 byte, and ty
|
||||
msg = [1,2,3].to_msgpack #=> "\x93\x01\x02\x03"
|
||||
MessagePack.unpack(msg) #=> [1,2,3]
|
||||
|
||||
**MessagePack-RPC** is cross-language RPC library for client, server and cluster applications. Because it releases you from complicated network programming completely and provides well-designed API, you can easily implement advanced network applications with MessagePack-RPC.
|
||||
|
||||
## Performance
|
||||
require 'msgpack/rpc'
|
||||
class MyHandler
|
||||
def add(x,y) return x+y end
|
||||
end
|
||||
svr = MessagePack::RPC::Server.new
|
||||
svr.listen('0.0.0.0', 18800, MyHandler.new)
|
||||
svr.run
|
||||
|
||||

|
||||
|
||||
In this test, it measured the elapsed time of serializing and deserializing 200,000 target objects. The target object consists of the three integers and 512 bytes string.
|
||||
The source code of this test is available from [frsyuki' serializer-speed-test repository.](http://github.com/frsyuki/serializer-speed-test)
|
||||
require 'msgpack/rpc'
|
||||
c = MessagePack::RPC::Client.new('127.0.0.1',18800)
|
||||
result = c.call(:add, 1, 2) #=> 3
|
||||
|
||||
|
||||
## Getting Started
|
||||
@ -29,9 +35,8 @@ Usage and other documents about implementations in each language are found at [t
|
||||
|
||||
## Learn More
|
||||
|
||||
- [Project Web Site](http://msgpack.org/)
|
||||
- [MessagePack format specification](http://wiki.msgpack.org/display/MSGPACK/Format+specification)
|
||||
- [Repository at github](http://github.com/msgpack/msgpack)
|
||||
- [Web Site](http://msgpack.org/)
|
||||
- [Wiki](http://wiki.msgpack.org/display/MSGPACK/Home)
|
||||
- [MessagePack-RPC](http://github.com/msgpack/msgpack-rpc)
|
||||
- [Issues](http://jira.msgpack.org/browse/MSGPACK)
|
||||
- [Sources](https://github.com/msgpack)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user