<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rustler on Medium]]></title>
        <description><![CDATA[Stories by Rustler on Medium]]></description>
        <link>https://medium.com/@Rustling_gopher?source=rss-7775e2e67245------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9qtgfNsN42Q15o6f.png</url>
            <title>Stories by Rustler on Medium</title>
            <link>https://medium.com/@Rustling_gopher?source=rss-7775e2e67245------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 15:20:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Rustling_gopher/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Benchmarking gRPC in Rust & Go]]></title>
            <link>https://medium.com/@Rustling_gopher/benchmarking-grpc-in-rust-go-184545e7688a?source=rss-7775e2e67245------2</link>
            <guid isPermaLink="false">https://medium.com/p/184545e7688a</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Rustler]]></dc:creator>
            <pubDate>Thu, 16 Jul 2020 07:43:45 GMT</pubDate>
            <atom:updated>2020-07-16T09:46:50.430Z</atom:updated>
            <content:encoded><![CDATA[<h3>Some background</h3><p>If you’re a developer looking to build a reliable, <a href="https://blog.gds-gov.tech/appreciating-rust-memory-safety-438301fee097">memory safe</a>, high performance application today, Rust &amp; Go are surely your options.</p><p>If you’re looking to get even more performance out of your internal applications, you might also want to look at using <a href="https://grpc.io/docs/what-is-grpc/introduction/">gRPC</a> instead of a normal <a href="https://restfulapi.net/">REST</a> api. All these are solutions to reducing your computational overhead.</p><p>I try to compare various libraries to understand their performance and hope you find it helpful.</p><h3>Libraries looked at</h3><ul><li><a href="https://github.com/tower-rs/tower-grpc">tower-grpc</a> (Rust)<br>A performant rust library, though it is replaced with tonic</li><li><a href="https://github.com/grpc/grpc-go">grpc-go</a> (Golang)<br>The official go module for grpc.</li><li><a href="https://github.com/stepancheg/grpc-rust">grpc-rust</a> (Rust)<br>Still in development, another grpc in rust. Looked promising.</li><li><a href="https://github.com/hyperium/tonic">tonic</a> (Rust)<br>An improved update from tower-grpc supporting the new await syntax</li><li><a href="https://github.com/grpc/grpc-node">grpc-node</a> (NodeJs)<br>Included for a benchmarking reference point.</li><li><a href="https://github.com/tikv/grpc-rs">grpc-rs</a> (Rust — C bindings)<br>A rust library that uses <a href="https://github.com/grpc/grpc">grpc</a></li></ul><h3>Benchmark Tool</h3><p>For the benchmark I’ll use the equivalent of <a href="https://github.com/rakyll/hey">Hey</a> for gRPC, <a href="https://github.com/bojand/ghz">ghz</a>.</p><p>The test will focus on how much overhead there is if the same load of 10,000 concurrent requests is sent to servers using each of the libraries above. I will use the same <a href="https://github.com/grpc/grpc-go/blob/master/examples/helloworld/helloworld/helloworld.proto">helloworld</a> greeter for each. TLS will not be enabled for any of the tests so we can get an idea of the raw performance with each.</p><h3>grpc-go</h3><pre>Summary:<br>  Count: 10000<br>  Total: 229.40 ms<br>  Slowest: 6.26 ms<br>  Fastest: 0.11 ms<br>  Average: 1.04 ms<br>  Requests/sec: 43591.54</pre><pre>Response time histogram:<br>  0.114 [1]    |<br>  0.728 [3355] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  1.343 [4580] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  1.957 [1519] |∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  2.572 [294]  |∎∎∎<br>  3.187 [36]   |<br>  3.801 [11]   |<br>  4.416 [74]   |∎<br>  5.030 [52]   |<br>  5.645 [45]   |<br>  6.259 [33]   |</pre><pre>Latency distribution:<br>  10 % in 0.46 ms<br>  25 % in 0.64 ms<br>  50 % in 0.88 ms<br>  75 % in 1.24 ms<br>  90 % in 1.68 ms<br>  95 % in 2.00 ms<br>  99 % in 4.77 ms</pre><pre>Status code distribution:<br>  [OK]   10000 responses</pre><h3>tonic</h3><pre>Summary:<br>  Count: 10000<br>  Total: 581.81 ms<br>  Slowest: 6.39 ms<br>  Fastest: 0.17 ms<br>  Average: 2.84 ms<br>  Requests/sec: 17187.66</pre><pre>Response time histogram:<br>  0.174 [1]    |<br>  0.796 [5]    |<br>  1.418 [6]    |<br>  2.040 [167]  |∎<br>  2.662 [3427] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  3.284 [5074] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  3.906 [1048] |∎∎∎∎∎∎∎∎<br>  4.528 [217]  |∎∎<br>  5.150 [29]   |<br>  5.773 [21]   |<br>  6.395 [5]    |</pre><pre>Latency distribution:<br>  10 % in 2.35 ms<br>  25 % in 2.55 ms<br>  50 % in 2.79 ms<br>  75 % in 3.07 ms<br>  90 % in 3.39 ms<br>  95 % in 3.66 ms<br>  99 % in 4.22 ms</pre><pre>Status code distribution:<br>  [OK]   10000 responses</pre><h3>grpc-node</h3><pre>Summary:<br>  Count: 10000<br>  Total: 589.25 ms<br>  Slowest: 12.56 ms<br>  Fastest: 1.21 ms<br>  Average: 2.88 ms<br>  Requests/sec: 16970.81</pre><pre>Response time histogram:<br>  1.206 [1]    |<br>  2.341 [2592] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  3.476 [5516] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  4.612 [1588] |∎∎∎∎∎∎∎∎∎∎∎∎<br>  5.747 [180]  |∎<br>  6.882 [42]   |<br>  8.017 [32]   |<br>  9.152 [5]    |<br>  10.288 [20]  |<br>  11.423 [6]   |<br>  12.558 [18]  |</pre><pre>Latency distribution:<br>  10 % in 2.14 ms<br>  25 % in 2.33 ms<br>  50 % in 2.62 ms<br>  75 % in 3.24 ms<br>  90 % in 3.85 ms<br>  95 % in 4.26 ms<br>  99 % in 6.41 ms</pre><pre>Status code distribution:<br>  [OK]   10000 responses</pre><h3>tower-grpc</h3><pre>Summary:<br>  Count: 10000<br>  Total: 571.88 ms<br>  Slowest: 10.59 ms<br>  Fastest: 0.25 ms<br>  Average: 2.76 ms<br>  Requests/sec: 17486.12</pre><pre>Response time histogram:<br>  0.246 [1]    |<br>  1.280 [139]  |∎<br>  2.314 [2927] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  3.348 [5198] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  4.382 [1390] |∎∎∎∎∎∎∎∎∎∎∎<br>  5.416 [114]  |∎<br>  6.450 [61]   |<br>  7.484 [80]   |∎<br>  8.518 [47]   |<br>  9.552 [31]   |<br>  10.586 [12]  |</pre><pre>Latency distribution:<br>  10 % in 1.80 ms<br>  25 % in 2.20 ms<br>  50 % in 2.65 ms<br>  75 % in 3.13 ms<br>  90 % in 3.64 ms<br>  95 % in 4.05 ms<br>  99 % in 7.18 ms</pre><pre>Status code distribution:<br>  [OK]   10000 responses</pre><h3>grpc-rust</h3><pre>Summary:<br>  Count: 10000<br>  Total: 479.30 ms<br>  Slowest: 8.15 ms<br>  Fastest: 0.90 ms<br>  Average: 2.34 ms<br>  Requests/sec: 20863.64</pre><pre>Response time histogram:<br>  0.901 [1]    |<br>  1.626 [193]  |∎<br>  2.351 [5587] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  3.076 [3562] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  3.801 [506]  |∎∎∎∎<br>  4.526 [119]  |∎<br>  5.251 [16]   |<br>  5.976 [5]    |<br>  6.701 [2]    |<br>  7.426 [2]    |<br>  8.151 [7]    |</pre><pre>Latency distribution:<br>  10 % in 1.87 ms<br>  25 % in 2.03 ms<br>  50 % in 2.25 ms<br>  75 % in 2.57 ms<br>  90 % in 2.90 ms<br>  95 % in 3.23 ms<br>  99 % in 4.11 ms</pre><pre>Status code distribution:<br>  [OK]   10000 responses</pre><h3>Grpc-rs</h3><pre>Summary:<br>  Count: 10000<br>  Total: 289.82 ms<br>  Slowest: 4.22 ms<br>  Fastest: 0.22 ms<br>  Average: 1.36 ms<br>  Requests/sec: 34504.74</pre><pre>Response time histogram:<br>  0.222 [1]    |<br>  0.621 [195]  |∎∎<br>  1.021 [1829] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  1.420 [4059] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  1.820 [2625] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎<br>  2.219 [972]  |∎∎∎∎∎∎∎∎∎∎<br>  2.618 [239]  |∎∎<br>  3.018 [45]   |<br>  3.417 [18]   |<br>  3.817 [6]    |<br>  4.216 [11]   |</pre><pre>Latency distribution:<br>  10 % in 0.87 ms<br>  25 % in 1.07 ms<br>  50 % in 1.30 ms<br>  75 % in 1.62 ms<br>  90 % in 1.90 ms<br>  95 % in 2.07 ms<br>  99 % in 2.56 ms</pre><pre>Status code distribution:<br>  [OK]   10000 responses</pre><h3>Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*O-BNW02Qt7AF5Iki_Limcg.png" /><figcaption>Total Reponse Time in Milliseconds. Lower is better.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bApjXrqyHcDAHtQdgKl71g.png" /><figcaption>Throughput (Requests/second). Higher is better.</figcaption></figure><h3>Conclusion</h3><p>The results indicate rust is on par with node in terms of performance, which was a bit of a shocking result.</p><p>The go library was extremely performant, both in concurrency &amp; minimal overhead.</p><p>If anyone has some thoughts to why the go library seems to be so performant relatively give me a shout out!</p><p>UPDATE: Thanks to <a href="https://www.reddit.com/user/Trisfald/">Trisfald</a> for suggesting grpc-rs as a (presently) more performant incarnation of gRPC in rust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=184545e7688a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>