4 ms·
Very nice compilation. How does these different libraries behave in terms of network performance? My use case is to download many small thumbnails and as the us
by aavegmittal 11y ago
Very nice compilation. How does these different libraries behave in terms of network performance? My use case is to download many small thumbnails and as the user scrolls up the view, I'd want to cancel the transfer for the images that has been out of view.
- bexp 11y agoI would recommend Fresco from Facebook, they had implemented cancellation logic also memory allocation done in more efficient way than other libs.
- aavegmittal 11y agoCool, thanks. Now, how are they handling "cancellation" of requests on the network (which have already been made). As far as I understand, HTTP/TCP has no option to cancel a transfer, without closing the connection itself (which would have other implications). So, once a request is made to the server, is there any option to Fresco to tell the server to stop it in some way?
- chetanahuja 11y agoYeah I think the HTTP cancellations get handled in local queue only. There's no way to "recall" an HTTP request once it has left the client except for simply closing the TCP connection. And you're right, closing the TCP connection means you have to create a new connection to do the next request and therefore I don't think any HTTP library actually does close the connection.
- bexp 11y agoFacebook using java.util.concurrent.Future<T> interface for downloading task: see here https://github.com/facebook/fresco/blob/c5e1d4cf2c081bf871f59f70cd02e4a68950ac41/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/HttpUrlConnectionNetworkFetcher.java https://github.com/facebook/fresco/blob/c5e1d4cf2c081bf871f5... you can ether call future.cancel() or cancel(true): in first case download task will be finished but further processing in pipeline will be stopped. Future.cancel(true) is more aggressive and abandons download but you will get InterruptedException. As you see from source code Facebook using less aggressive approach with future.cancel(false) call.
- aavegmittal 11y agoyeah, thats what I thought. These libraries do help to some extent but I think the underlying problem of TCP still remains the same. I wonder how these libraries are handling the problem of request pipelining.
- on_and_off 11y ago> memory allocation done in more efficient way than other libs. That's one way to see it ... They are relying on a very ugly hack that makes everybody cringe, including Engineers from the Android Graphics team.
- anhsirkdasarp 11y agoHow different is robospice from these? Auther didn't mention anything on this library on the post.