Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve speed #6

Open
nicois opened this issue Jun 30, 2024 · 1 comment
Open

Improve speed #6

nicois opened this issue Jun 30, 2024 · 1 comment

Comments

@nicois
Copy link

nicois commented Jun 30, 2024

Nice work. Coming here via HN.

There have been a few examples on HN on how to dramatically speed up sqlite access with a few configuration tweaks. I've encapsulated these in https://pkg.go.dev/github.com/nicois/fastdb . Looking at your code, I think you would support significantly greater throughput under heavy load when using this approach, splitting our your SELECT calls from mutating database calls.

I can make a PR if you like, using the above module, or you might choose to implement these few settings yourself directly. The key settings can be seen here: https://github.com/nicois/fastdb/blob/main/main.go#L97

@poundifdef
Copy link
Owner

If you can share some before/after benchmarks on this repository then I'd be happy to take a closer look. I'm not sure that all of these settings make sense. Nearly every operation is a write (enqueue/dequeue). I'm not familiar enough with the durability of different synchronization pragmas, so I'd be interested to think through what is "safe enough" in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants