Re-implement getExecutor() method for better performance and efficiency? #4969
-
Hi! I'm struggling with an issue that firestore query response is about 4x slower on Android than on iOS, in some cases. And I found out that the library handle async job with It seems to create single-thread executor for each module(auth, firestore, etc). But Android reference says use of a cached thread pool will typically improve the performance of programs that execute many short-lived asynchronous tasks: https://developer.android.com/reference/java/util/concurrent/Executors#newCachedThreadPool() I locally modified Also, the current implementation always has fixed threads depending on the number of modules, but the thread pool kills unnecessary threads, it can be more efficient in terms of resource management. I think changing the implementation of I'm considering to make PR for this, so I'm wondering if there is a reason to create a single thread executor. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm very interested in this - we have had reports of query performance being slow on Android but have been unable to resolve it, you may have hit the root cause (or, "a" root cause, but perhaps a big one) Please post the PR either way, I'd love to see it, but in general either @Salakar or @Ehesp would have to answer the architecture question of "does react-native-firebase use single-threaded Executor per module on purpose, or was it simply expedient and making it a thread pool is fine" |
Beta Was this translation helpful? Give feedback.
I'm very interested in this - we have had reports of query performance being slow on Android but have been unable to resolve it, you may have hit the root cause (or, "a" root cause, but perhaps a big one)
Please post the PR either way, I'd love to see it, but in general either @Salakar or @Ehesp would have to answer the architecture question of "does react-native-firebase use single-threaded Executor per module on purpose, or was it simply expedient and making it a thread pool is fine"