Request: Performance comparison between acebase and alternatives #54
Replies: 3 comments
-
This thing is incredible btw |
Beta Was this translation helpful? Give feedback.
-
Here's a somewhat silly example of perf on transactions. It takes about 1.4 seconds in node 17 on my 2015 macbook pro. I included a dummy function using promises to make sure they weren't the slow part – took about 3 milliseconds. Anyway, 1.4 seconds for 1000 db transactions is not bad at all. async function aliceStuff() {
const alice = db.ref('alice')
await alice.set({ x: 1, y: 1 })
let start = performance.now()
await Promise.all(Array(1000).fill().map(() =>
alice.transaction(snap => {
const val = snap.val()
val.x += 1
val.y += val.x
return val
})))
let end = performance.now()
console.log('elapsed:', end - start)
console.log('alice is now', (await alice.get()).val())
start = performance.now()
const expected = await getExpected()
end = performance.now()
console.log('elapsed:', end - start)
console.log('expected:', expected)
}
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
async function getExpected() {
let x = 1
let y = 1
await Promise.all(Array(1000).fill().map(async () => {
await sleep(1)
x += 1
y += x
}))
return [x, y]
} |
Beta Was this translation helpful? Give feedback.
-
Great idea to do performance comparison with other databases. If you feel like doing some, please do! Great test you posted above, that is a great result! 🚀 |
Beta Was this translation helpful? Give feedback.
-
Wouldn't have to be anything fancy. Make a million tables, add a million records each, sort by fields, then measure RAM, CPU, and time.
Beta Was this translation helpful? Give feedback.
All reactions