-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
groupcache: enable H2C + add benchmarks
Add h2c benchmarks. Somehow h2c is slowed than regular HTTP locally for me. Probably because these aren't real life benchmarks i.e. establishing TCP connections locally has no cost. And if there is only one operation happening at any time then h2 has to do more work hence more CPU usage. With 500 parallel requests going on at the same time, h2 becomes faster than (or is at the same level as) h1 while using a minimal number of TCP connections. Thus, it will work much faster in real life situations. So, let's enable it. ``` name time/op GroupcacheRetrieval/h2c/seq-16 227µs ± 1% GroupcacheRetrieval/h2c/parallel=500-16 54.8µs ±20% GroupcacheRetrieval/h1,_max_one_TCP_connection/seq-16 150µs ± 2% GroupcacheRetrieval/h1,_max_one_TCP_connection/parallel=500-16 146µs ± 1% GroupcacheRetrieval/h1,_unlimited_TCP_connections/seq-16 145µs ± 3% GroupcacheRetrieval/h1,_unlimited_TCP_connections/parallel=500-16 52.8µs ± 9% name alloc/op GroupcacheRetrieval/h2c/seq-16 183kB ± 0% GroupcacheRetrieval/h2c/parallel=500-16 143kB ± 1% GroupcacheRetrieval/h1,_max_one_TCP_connection/seq-16 161kB ± 0% GroupcacheRetrieval/h1,_max_one_TCP_connection/parallel=500-16 162kB ± 0% GroupcacheRetrieval/h1,_unlimited_TCP_connections/seq-16 161kB ± 0% GroupcacheRetrieval/h1,_unlimited_TCP_connections/parallel=500-16 116kB ± 2% name allocs/op GroupcacheRetrieval/h2c/seq-16 283 ± 0% GroupcacheRetrieval/h2c/parallel=500-16 256 ± 1% GroupcacheRetrieval/h1,_max_one_TCP_connection/seq-16 260 ± 0% GroupcacheRetrieval/h1,_max_one_TCP_connection/parallel=500-16 262 ± 0% GroupcacheRetrieval/h1,_unlimited_TCP_connections/seq-16 260 ± 0% GroupcacheRetrieval/h1,_unlimited_TCP_connections/parallel=500-16 279 ± 1% ``` Signed-off-by: Giedrius Statkevičius <[email protected]>
- Loading branch information
Showing
7 changed files
with
207 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters