Replies: 8 comments 3 replies
-
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: |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I added some more benchmarks: https://git.jlel.se/jlelse/GoSqliteBench/src/commit/7171467de1ad2da8390436d91e4e404af7db45d4/SqliteBench_test.go This are the results:
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Looks like the mutex functions introduce some overhead. |
Beta Was this translation helpful? Give feedback.
-
An alternative to the mutex in the pool struct might be to use a sync.Map. |
Beta Was this translation helpful? Give feedback.
-
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 ? |
Beta Was this translation helpful? Give feedback.
-
I moved an event sourcing system from crawshaw to zombiezen. This is writing to 2 tables per event, thought I might be of some value for discussions. While slower on write it does flatten out well. Very curiously about the details related to why in modernc/sqlite the reads can be so much faster, Haven't test out fully if anyone has a deeper understanding I'd love to know |
Beta Was this translation helpful? Give feedback.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions