You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest an improvement over the current main interface KeyReaderAt. Taking a look at the handler implementations, it appears most of them use io.ReadFull(r.Body, p) to return the buffer to the adapter.
Taking advantage of that, I think we could define as well a KeyStreamerAt interface:
It is to io.SectionReader what is osio.KeyReaderAt to io.ReaderAt.
The key idea is that when ranges are fetched, all mutexes are blocked whereas we could release them progressively to decrease the contention on other reads.
Example:
GDAL needs range .BCDEF for first read,
GDAL needs range AB for second read.
The second read needs to wait for the block range request to finish before serving the second range. With the new implementation, the Adapter can return sooner for the second read.
It gives something like that in my current implementation for the adapter:
Hello Thomas,
I would like to suggest an improvement over the current main interface
KeyReaderAt
. Taking a look at the handler implementations, it appears most of them useio.ReadFull(r.Body, p)
to return the buffer to the adapter.Taking advantage of that, I think we could define as well a
KeyStreamerAt
interface:It is to
io.SectionReader
what isosio.KeyReaderAt
toio.ReaderAt
.The key idea is that when ranges are fetched, all mutexes are blocked whereas we could release them progressively to decrease the contention on other reads.
Example:
.BCDEF
for first read,AB
for second read.The second read needs to wait for the block range request to finish before serving the second range. With the new implementation, the Adapter can return sooner for the second read.
It gives something like that in my current implementation for the adapter:
It could be backward compatible by simple checking if the handler implements the interface:
Thomas
The text was updated successfully, but these errors were encountered: