firebase / firebase/firebase-android-sdk

Add an option to set UPLOAD_POOL_SIZE and DOWNLOAD_POOL_SIZE

Open
#6,850 1 comment 0 reactions 0 assignees View on GitHub
api: storage type: feature request
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 23h
Merged PRs (30d)
34

Description

## What feature would you like to see?
Describe the feature you would like to add, ideally proposing a specific API.

I would like an option to set `UPLOAD_POOL_SIZE` and `DOWNLOAD_POOL_SIZE`, for the `UPLOAD_QUEUE_EXECUTOR` and `DOWNLOAD_QUEUE_EXECUTOR` in `StorageTaskScheduler`.
Currently, as I see it, those executors are initialize [when Firebase is loaded](https://github.com/firebase/firebase-android-sdk/blob/dbf5d014ab08cf3d86b6e31d2650afad451fdb3c/firebase-storage/src/main/java/com/google/firebase/storage/StorageTaskScheduler.java#L43), so I'm not sure where and what would be the correct place to modify those values.

## How would you use it?
Tell us how you'd use this feature in your app.

One of my clients needs to upload a batch of lots of small files.
On iOS where Firebase relies on the OS for the parallel limits, it allows much more uploads at a time, and uploading all the files together is fast.

On Android, currently the limit of `UPLOAD_POOL_SIZE` is `2`.([see this line](https://github.com/firebase/firebase-android-sdk/blob/dbf5d014ab08cf3d86b6e31d2650afad451fdb3c/firebase-storage/src/main/java/com/google/firebase/storage/StorageTaskScheduler.java#L35))
Uploading the batch in Parallel on Android is faster than uploading the files one by one, but it's still 5 to 10 times slower than iOS, as the limit is too low.

Maybe there's a reason for such a low value, as it might was useful for some apps in the past, but I think that letting the developers to optimize this aspect of the app is better.

Looking for a solution, I didn't find a mentioned of this issue on Github, but I found some posts on stackoverflow, like [this one](https://stackoverflow.com/questions/60163889/android-firebase-storage-sdk-maximum-parallel-uploads) that suggested to edit the source and rebuild it by ourselves.
It is possible as a last resort, but it's not sustainable to maintain it, and make it even more complicated when using the SDK in other frameworks and engines like Unity.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.