3 ms·
I did a small benchmark on some trivial code: https://gist.github.com/markuswustenberg/8be63c6e95dc5bb50fff6e14cc26f5eb https://gist.github.com/markuswustenberg
by markusw 4y ago
I did a small benchmark on some trivial code: https://gist.github.com/markuswustenberg/8be63c6e95dc5bb50fff6e14cc26f5eb https://gist.github.com/markuswustenberg/8be63c6e95dc5bb50ff...
Results vary a bit on my machine, but it's pretty much the same (unless I'm doing something wrong, please point it out if so):
$ make benchmark
go test -bench=.
goos: darwin
goarch: arm64
pkg: sqlite
BenchmarkWriteBlogPost/write_blog_post_without_WAL-8 6036 186719 ns/op
BenchmarkWriteBlogPost/write_blog_post_with_WAL-8 102567 11169 ns/op
BenchmarkWriteBlogPost/write_blog_post_with_WAL_and_Go_mutex-8 104228 11226 ns/op
PASS
ok sqlite 3.833s
- markusw 4y agoMy mistake, this isn’t parallel. See https://news.ycombinator.com/item?id=33911491 https://news.ycombinator.com/item?id=33911491 for a parallel version with no readers.