-
Notifications
You must be signed in to change notification settings - Fork 993
Closed
Labels
Description
Describe your environment
- Operating System version: OS X El Capitan. v 10.11.6
- Firebase SDK version: 4.5.1
- Firebase Product: firestore
Describe the problem
When fetching about 100 documents by their ids using the firebase-js-sdk, I have noticed a significant delay till all fetches have been resolved. between 1 ~ 2 seconds.
On the other hand, the same fetch done using firebase-admin-node has been consistently outperforming the firebase-js-sdk at about 200 ~ 300ms
Steps to reproduce:
Use the sdk to create multiple docs fetch promises and measure how long till all of them are resolved.
And then compare the time took with the same code executed using a firestore from the firebase-admin-node
Relevant Code:
Here is the code that is being executed by both the firebase-js-sdk and the firebase-admin-node
const petIds = // Ids of pet docs I wanna fetch
const time = new Date().getTime()
// create the fetches
const fetches = petIds.map(id => {
return firestore.collection('pets').doc(id).get()
})
// wait for them to resolve
const docs = await Promise.all(fetches)
console.log(`It took ${new Date().getTime() - time} ms`)petrskalicka and krisztianodor