3 ms·
It doesn't strike me as the best language for embedding SQLite given the need to constantly cross the Cgo boundary. But I'm sure it still works fine.
by simscitizen 4y ago
It doesn't strike me as the best language for embedding SQLite given the need to constantly cross the Cgo boundary. But I'm sure it still works fine.
- iansinnott 4y agoAlthough not mentioned in the article, there is a CGo-free port of SQLite which can be used as an alternative to the usual driver: https://pkg.go.dev/modernc.org/sqlite https://pkg.go.dev/modernc.org/sqlite
- Cwizard 4y agoNot relevant if you are interested in performance. This go only version is much slower than the cgo overhead. (At least it was a year ago, do your own benchmarks)
- Loic 4y agoIt works very well. We are running a search engine for chemical properties in Go+SQLite and the speed is simply incredible to the point people think it is a static website. Here is a page with quite some queries to render: https://www.chemeo.com/cid/58-801-8/Pentane https://www.chemeo.com/cid/58-801-8/Pentane
- markusw 4y agoHaha, I’ve heard that comment before as well. If it’s _too_ fast, it feels suspicious, like it’s not doing anything. I think we’ve collectively forgotten how fast dynamic websites can be on modern hardware!
- mappu 4y ago> A benchmark performed on go 1.15 showed 60ns of overhead for calls into C This concern is a bit overblown, the Cgo boundary is heavier than an ordinary function call but still a zillion times faster than doing disk I/O on the database.