[GH-ISSUE #50] Request: Performance comparison between acebase and alternatives #37

Closed
opened 2026-05-23 08:27:27 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @qpwo on GitHub (Dec 7, 2021).
Original GitHub issue: https://github.com/appy-one/acebase/issues/50

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.

Originally created by @qpwo on GitHub (Dec 7, 2021). Original GitHub issue: https://github.com/appy-one/acebase/issues/50 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.
Author
Owner

@qpwo commented on GitHub (Dec 7, 2021):

This thing is incredible btw

<!-- gh-comment-id:988278242 --> @qpwo commented on GitHub (Dec 7, 2021): This thing is incredible btw
Author
Owner

@qpwo commented on GitHub (Dec 7, 2021):

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]
}
<!-- gh-comment-id:988319203 --> @qpwo commented on GitHub (Dec 7, 2021): 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. ```js 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] } ```
Author
Owner

@appy-one commented on GitHub (Dec 8, 2021):

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! 🚀

<!-- gh-comment-id:988693912 --> @appy-one commented on GitHub (Dec 8, 2021): 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! 🚀
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#37
No description provided.