Age | Commit message (Collapse) | Author |
|
|
|
This lead to the following consequences:
* we could efficiently read from storage - if block intersects files
boundaries then we will "view" the block in the two different
bytestrings. To avoid concat we now return lazy bytestring;
* we could read block from socket without "concat" - again, for the
same reason.
The pitfail is that now we have a bit more heap object, but blocks
lifetime is very short and this shouldnt play the big difference. The
lifetime is either (socket -> storage -> unreachable) or (storage ->
socket -> unreachable) unless a lib user keep block for their own
purposes.
|
|
The 'getPiece' is internal function, so no need to copy the all piece.
This optimization removes 5% of overall program allocation.
|
|
|
|
Now we can download and make some progress, but very unstable.
|
|
|
|
|
|
This way we can hide some session <-> storage details.
|