This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Question about performance #22
Comments
Yay, thanks!
Your benchmark seems like it's a pretty direct comparison in operations. I'd be curious to see whether it makes a difference to move the You may be interested in looking at the upstream performance issues: |
Thanks for the links. Makes sense, it's probably due to the C to Go translation. After all +67% isn't too bad after all. But sure, I will try it without the DB pool. |
I added some more benchmarks: https://git.jlel.se/jlelse/GoSqliteBench/src/commit/7171467de1ad2da8390436d91e4e404af7db45d4/SqliteBench_test.go This are the results:
|
I'm surprised the sequential case performs worse for both packages. You might want to use the Go CPU profiler on those benchmarks to try to get a sense for what's the bottleneck. |
Looks like the mutex functions introduce some overhead. |
An alternative to the mutex in the pool struct might be to use a sync.Map. |
Just a heads up sync.Map is just a wrapper for a mutex and map. Would a RWMutex help? What's the ratio of read to write ? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hello,
I was searching for alternatives to mattn/go-sqlite3 and came across this library. I really like it so far!
But because I don't just want to make my Go programs a lot slower, I thought about doing some benchmarks first. (I'm new to benchmarking in Go!) You can see them here: https://git.jlel.se/jlelse/GoSqliteBench/src/commit/12db3eac1fd3c0d32e078e9a2d8feb917e83df84/SqliteBench_test.go
Unfortunately the results look like this:
Am I doing something wrong? Why is this library so much slower?
The text was updated successfully, but these errors were encountered: