Commit Graph

6 Commits

Author SHA1 Message Date
Steve Cohen
77f22b75dd Server benchmark (#155)
* Added simple server benchmark

Updated README.md with benchmark results
2017-01-05 15:46:49 -08:00
Preston Guillory
ba2f03d59d Remove UnionSerializationBenchmark (#101)
The changes to ParserUtils were fumbled and broke BinaryProtocolBenchmark,
which is the more valuable benchmark. UnionSerializationBenchmark was used to
check the performance impact of a particular commit and isn't really worth
maintaining.
2016-12-29 14:10:37 -08:00
Jon Parise
e79b711818 Add the u field to ParserUtil's User support 2016-12-28 18:01:44 -08:00
Jon Parise
6963b315db Add _bench.exs suffixes to benchfella scripts (#96)
This allows the `mix bench` command to automatically discover its test
scripts.

Also, we only need to build benchfella in :dev and not :test.
2016-12-28 16:35:15 -08:00
Preston Guillory
14ba9f0183 Match unions with zero or one field set (#90)
* Match unions with zero or one field set

This uses matching in the `serialize` definition to enforce that only unions
with zero or one field can be serialized.
2016-12-27 16:09:04 -08:00
Preston Guillory
819216f830 Pure elixir implementation (#54)
A pure Elixir implementation of the Thrift binary protocol.

This PR includes serialization and deserialization for all thrift types as well as testing to make sure we match the thrift spec (which can be found here: https://erikvanoosten.github.io/thrift-missing-specification/#_binary_encoding)

The binary protocol is generated alongside the thrift data types, yielding a much faster implementation than the apache project's canonical one. 

Our benchmarks (using benchfella) indicate a speedup of between 10 and 20x.

## Binary Protocol Performance
benchmark name |  iterations | average time 
------------------|-----------|---------------
elixir serialization (left as IOList)                   |  2000  | 849.01 µs/op
elixir serialization (iolist_size)                        |  2000  | 933.83 µs/op
elixir serialization (converted to binary)        | 1000   | 1281.23 µs/op
elixir deserialization                                       |  1000   | 1178.46 µs/op
erlang serialization left as IOList                    |   100   | 10284.84 µs/op
erlang serialization (converted to binary)      |   100   | 11588.89 µs/op
erlang deserialization                                      |   100   | 21433.17 µs/op
2016-11-30 11:31:59 -08:00