Improve data reading performance by inlining hot methods in RecyclableMemoryStream
Description
Any column value that is read by the driver, requires two operations of read from the underlying stream. One for reading the length in bytes of the value and the other one for reading the actual value. Therefore, the process of reading data from the stream is very hot and any micro-optimisation that can be made there can result in overall performance improvements. When we profile the driver, we can see that two methods: CheckDisposed and {{GetBlockAndRelativeOffset }} are particularly hot which makes them worth inlining.
Any column value that is read by the driver, requires two operations of read from the underlying stream. One for reading the length in bytes of the value and the other one for reading the actual value. Therefore, the process of reading data from the stream is very hot and any micro-optimisation that can be made there can result in overall performance improvements. When we profile the driver, we can see that two methods:
CheckDisposed
and {{GetBlockAndRelativeOffset }} are particularly hot which makes them worth inlining.