Skip to content
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

Firestore call takes 10 times more time on Android than iOS #696

Open
CiprianGabor opened this issue Jan 20, 2025 · 0 comments
Open

Firestore call takes 10 times more time on Android than iOS #696

CiprianGabor opened this issue Jan 20, 2025 · 0 comments

Comments

@CiprianGabor
Copy link

I have this simple function on my KMM repo:

suspend fun getUserProfile(): UserInfo?
{
    val start = Clock.System.now()
    val result =  firestore.collection("User").document(auth.currentUser!!.uid).snapshots
        .mapLatest { user ->
            user.data<UserInfo>()
        }
        .firstOrNull()
    val end = Clock.System.now()
    println("time: ${(end-start).inWholeMilliseconds}")
    return result
}

Do you have any insights into why it takes about 2000ms on Android and around 200ms on iOS? The Android call is about 10 times slower, which is impacting the UI. Keep in mind that is a Kotlin Multiplatform repo, so it runs the same function for both phones.

Thanks for the help.

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

No branches or pull requests

1 participant