Skip to content

[Android] Optimize Secure Storage by Replacing Single Worker Thread with Thread Pool #906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

farmery
Copy link

@farmery farmery commented Mar 8, 2025

Problem

Secure storage operations were previously executed on a single worker thread. This becomes a bottleneck when multiple read operations are triggered simultaneously, leading to significant delays due to the synchronous execution on the native side.

Solution

Replaced the single worker thread with a thread pool (using Executors.newCachedThreadPool()). This allows multiple secure storage operations to run concurrently, significantly improving performance when handling simultaneous read/write requests.

Impact

Reduces contention and latency for secure storage operations.
Improves app responsiveness when multiple storage operations are triggered.
No changes in API usage—just an internal optimization for Android.

@farmery
Copy link
Author

farmery commented Mar 15, 2025

HI @juliansteenbakker, please can you take a look?🙏🏾

@farmery
Copy link
Author

farmery commented Apr 7, 2025

@juliansteenbakker Hii...👀

@juliansteenbakker
Copy link
Owner

So sorry for the delay, im on vacation till friday, will take a look when i get back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants