Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new msgpack implementation #85

Merged
merged 3 commits into from Apr 4, 2015

Conversation

dmcgowan
Copy link
Contributor

This change include use of a new msgpack implementation based on a fork of github.com/vmihailenco/msgpack. The changes were to support libchan were extended types, interface encoding, raw messages, and removing of a non-standard time encoding.

Additional cleanup changes to support this PR include removing of the raw connection encoding in the spdy implementation which was never defined in the libchan protocol.

Includes:

  • Different msgpack implementation
  • New raw message type
  • New extension implementation

What this enables:

  • More efficient proxying
  • Zero copy in-memory channel transfer
  • Partial Decoding
  • Sending/receiving non struct/map objects

fixes #47

@dmcgowan dmcgowan added this to the v0.2.0 milestone Feb 17, 2015
@dmcgowan dmcgowan force-pushed the new_msgpack_implementation branch 3 times, most recently from fad4fb1 to 3d7fef7 Compare February 23, 2015 16:40
@dmcgowan
Copy link
Contributor Author

dmcgowan commented Apr 4, 2015

Benchmark results from master

benchmark                      old ns/op     new ns/op     delta
BenchmarkSimpleCopy            33875         31879         -5.89%
BenchmarkSimpleLocalProxy      42671         32168         -24.61%
BenchmarkSimpleSpdyProxy       47215         41632         -11.82%
BenchmarkSimpleNoProxy         19527         14029         -28.16%
BenchmarkSimpleLocalPipe       8969          1271          -85.83%
BenchmarkComplexCopy           538147        585687        +8.83%
BenchmarkComplexLocalProxy     691576        490625        -29.06%
BenchmarkComplexSpdyProxy      733329        729876        -0.47%
BenchmarkComplexNoProxy        334096        246488        -26.22%
BenchmarkComplexLocalPipe      46666         1729          -96.29%

benchmark                      old allocs     new allocs     delta
BenchmarkSimpleCopy            78             52             -33.33%
BenchmarkSimpleLocalProxy      91             53             -41.76%
BenchmarkSimpleSpdyProxy       116            78             -32.76%
BenchmarkSimpleNoProxy         40             26             -35.00%
BenchmarkSimpleLocalPipe       12             2              -83.33%
BenchmarkComplexCopy           1000           955            -4.50%
BenchmarkComplexLocalProxy     1104           956            -13.41%
BenchmarkComplexSpdyProxy      1489           1437           -3.49%
BenchmarkComplexNoProxy        523            472            -9.75%
BenchmarkComplexLocalPipe      134            8              -94.03%

benchmark                      old bytes     new bytes     delta
BenchmarkSimpleCopy            2921          1226          -58.03%
BenchmarkSimpleLocalProxy      3738          1257          -66.37%
BenchmarkSimpleSpdyProxy       4623          2160          -53.28%
BenchmarkSimpleNoProxy         1310          398           -69.62%
BenchmarkSimpleLocalPipe       392           16            -95.92%
BenchmarkComplexCopy           154988        161975        +4.51%
BenchmarkComplexLocalProxy     226245        161992        -28.40%
BenchmarkComplexSpdyProxy      251307        261698        +4.13%
BenchmarkComplexNoProxy        62217         63535         +2.12%
BenchmarkComplexLocalPipe      39057         512           -98.69%

@drewwells
Copy link
Contributor

This looks awesome! Are these benchmarks checked in somewhere?

@dmcgowan
Copy link
Contributor Author

dmcgowan commented Apr 4, 2015

Not yet, let me make a PR and get them into master

- Reintroduce SendTo and ReceiveFrom
- Use raw message when receiving from spdy
- Zero copy in-mem transport
- Remove raw connection encoding

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Update Send and Receive objects to lock access and save their encoder/decoder.  Additionally use a buffered writer on encode.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
@dmcgowan
Copy link
Contributor Author

dmcgowan commented Apr 4, 2015

In memory pipe benchmark results

benchmark              old ns/op     new ns/op     delta
BenchmarkRoundTrip     21897         1868          -91.47%

benchmark              old allocs     new allocs     delta
BenchmarkRoundTrip     20             0              -100.00%

benchmark              old bytes     new bytes     delta
BenchmarkRoundTrip     752           0             -100.00%

dmcgowan added a commit that referenced this pull request Apr 4, 2015
@dmcgowan dmcgowan merged commit 78678c1 into docker:master Apr 4, 2015
@dmcgowan dmcgowan deleted the new_msgpack_implementation branch April 4, 2015 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MsgPack improvements
3 participants