Track absolute position of the cursor
Summary:
Start tracking the position of the cursor from the head of IOBuf chain. This comes at almost no cost (one arithmetic operation on IOBuf advance).
The main use case for this cursor is Thrift deserialization code. It allows us to stop accumulating `xfer` on every single byte/field/element write and instead get it from Cursor in the end (when we're exiting Thrift code).
This allows achieving ~10% better performance of deserialization.
Reviewed By: yfeldblum
Differential Revision:
D6646813
fbshipit-source-id:
8f796854a24a411698e96afe037695e816813022