Skip to content

Improve performance by not locking the database #156

@mokurin000

Description

@mokurin000

In my testing branch human-readable-perf, I replaced the current Arc<Mutex<Connection>> pattern with a background thread receiving a command and a oneshot channel, to send result back

And the replacement will increase average performance of insertion by 12.5%, see report-.zip generated by wastebin-bench.

TL;DR: from ~40k QPS to ~45k QPS, benched on i7-12700H running archlinux (mainline kernel)

cargo r -r -- --host http://127.0.0.1:8088 --run-time 30

The main cost is readability of the code (I did not find a design not such ugly for now)

As it's just for performance test, only insert is implemented in the -perf branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions