Defines two new DialInfo fields: ReadTimeout, and WriteTimeout, defaulting to DialInfo.Timeout for backwards compatibility.
Removes passing multiple copies of the timeout value throughout the codebase, instead keeping a reference to a copy of the DialInfo which should make future refactoring easier (all the information is available everywhere, rather than ad-hock passing in function arguments).
As a nice bonus, because the same DialInfo instance is referenced by all sockets rather than each socket referencing its own copy of the timeout value in the hot path, the increased cache locality has reduced operation latency by ~15% resulting in ~1700/s increase in read throughput.
Fixes #160.
Defines two new
DialInfo
fields:ReadTimeout
, andWriteTimeout
, defaulting toDialInfo.Timeout
for backwards compatibility.Removes passing multiple copies of the timeout value throughout the codebase, instead keeping a reference to a copy of the
DialInfo
which should make future refactoring easier (all the information is available everywhere, rather than ad-hock passing in function arguments).As a nice bonus, because the same
DialInfo
instance is referenced by all sockets rather than each socket referencing its own copy of the timeout value in the hot path, the increased cache locality has reduced operation latency by ~15% resulting in ~1700/s increase in read throughput.efe0945164a7e582241f37ae8983c075f8f2e870-timeout-insert-latency.txt efe0945164a7e582241f37ae8983c075f8f2e870-timeout-insert-throughput.txt efe0945164a7e582241f37ae8983c075f8f2e870-timeout-select-zipfian-latency.txt efe0945164a7e582241f37ae8983c075f8f2e870-timeout-select-zipfian-throughput.txt efe0945164a7e582241f37ae8983c075f8f2e870-timeout-update-zipfian-latency.txt efe0945164a7e582241f37ae8983c075f8f2e870-timeout-update-zipfian-throughput.txt