thrift
thrift copied to clipboard
Profile the rust library.
The Rust library is ~100x slower than the C++ version. Lets run a profiler to find out why.
Good news, after a suggestion at the last meetup to use BufferedStream the numbers are much better:
[golov@localhost rs]$ time ./target/release/calculator ping() 0 100 ... 1700 1800 1900 1 + 1 = 2 PASS
real 0m0.107s user 0m0.016s sys 0m0.016s
Compared with C++: [golov@localhost cpp]$ time ./TutorialClient ping() 0 100 ... 1700 1800 1900
real 0m0.122s user 0m0.024s sys 0m0.032s
The values are representative for several (>5) runs. Typical real times for Rust are ~15% lower than for C++.
The code is on the quick-benchmark branch: https://github.com/maximg/thrift/commit/9cde36a13aa5ed494a9923f6eeb6ca77b7cb1fdc, I will clean up and integrate it later today.
Awesome news! Tell me if you need some help cleaning or rebasing it.
Could you review the way I've added it to the transport? Feel free to adapt it if you think it should be a separate file.
https://github.com/maximg/thrift/commit/351dbe93609bc3784997c0be6484250a065e24a2
On Sun, Feb 1, 2015 at 5:56 PM, Simon Génier [email protected] wrote:
Awesome news! Tell me if you need some help cleaning or rebasing it.
— Reply to this email directly or view it on GitHub https://github.com/maximg/thrift/issues/9#issuecomment-72372611.
Looks good! Nice to see that kind of improvement for such a small change.
I don't think it's worth creating a new module only for that, so I'd keep it in that file. Also, should we remove the Transport
implementation for TcpStream
so users don't make the same mistake as us and experience degraded performances?
That's probably a good idea, we could add a comment that if for some reason there is a need to use raw tcp transport it can be done, but that it is not provided by default.
On Sun, Feb 1, 2015 at 7:34 PM, Simon Génier [email protected] wrote:
Looks good! Nice to see that kind of improvement for such a small change.
I don't think it's worth creating a new module only for that, so I'd keep it in that file. Also, should we remove the Transport implementation for TcpStream so users don't make the same mistake as us and experience degraded performances?
— Reply to this email directly or view it on GitHub https://github.com/maximg/thrift/issues/9#issuecomment-72377092.
Should we close this issue for now and reopen if anything else comes up?
I think it is good to have it as a reminder before we go to main. Do you think we could use it to do performance measurements on the mutlithreaded server?
A simple benchmark is available in tutorial/rs/src/benchmark.rs and tutorial/cpp/CppBenchmark.cpp