Created
April 28, 2020 18:57
-
-
Save schmidt-sebastian/d2bc9e77becaf8b75359407d744fd0c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await db.doc('foo/bar').set({}); | |
const start = Date.now(); | |
const promises = Array.from({length: 500}).map((_, index) => { | |
db.doc("a/" + index).set({}); | |
}); | |
const middle = Date.now(); | |
await Promise.all(promises); | |
const end = Date.now(); | |
console.log("Midpoint " + (middle - start)); | |
console.log("End " + (end - start)); | |
versus: | |
await db.doc('foo/bar').set({}); | |
const start = Date.now(); | |
const promises = Array.from({length: 500}).map((_, index) => { | |
db.doc("a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/" + index).set({}); | |
}); | |
const middle = Date.now(); | |
await Promise.all(promises); | |
const end = Date.now(); | |
console.log("Midpoint " + (middle - start)); | |
console.log("End " + (end - start)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment