Skip to content

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

Open
@CiprianGabor

Description

@CiprianGabor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions