docker / libchan

Like Go channels over the network
Apache License 2.0
2.47k stars 142 forks source link

Use new msgpack implementation #85

Closed dmcgowan closed 9 years ago

dmcgowan commented 9 years ago

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:

What this enables:

fixes #47

dmcgowan commented 9 years ago

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 commented 9 years ago

This looks awesome! Are these benchmarks checked in somewhere?

dmcgowan commented 9 years ago

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

dmcgowan commented 9 years ago

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%