3 ms·
Being translated means it doesn't have the normal cgo calling overhead. It also means you can cross compile it for every platform that the Go toolchain supports
by psanford 5y ago
Being translated means it doesn't have the normal cgo calling overhead. It also means you can cross compile it for every platform that the Go toolchain supports without any external compilers.
- throwaway894345 5y agoOP mentioned that the pure-Go version is ~6 times slower, so the cgo calling overhead is clearly made up for by C. Also, I've heard that sqlite is the rare piece of C software that is actually bulletproof, so I don't think the pure-Go version can make the usual boasts about correctness and security in this particular case. Not needing extra external compilers is still a nice proposition, however.
- tgv 5y agoEspecially for portability/cross compiling.
- justinsaccount 5y agoNope, note their readme says: These combinations of GOOS and GOARCH are currently supported darwin amd64, darwin arm64, freebsd amd64, linux 386, linux amd64, linux arm, linux arm64, windows amd64 and if you look at their source tree https://gitlab.com/cznic/sqlite/-/tree/master/lib https://gitlab.com/cznic/sqlite/-/tree/master/lib you can see they have sqlite_darwin_amd64.go sqlite_darwin_arm64.go sqlite_freebsd_amd64.go sqlite_linux_386.go sqlite_linux_amd64.go sqlite_linux_arm.go sqlite_linux_arm64.go sqlite_linux_s390x.go sqlite_windows_386.go sqlite_windows_amd64.go
- therein 5y agoThat's nice and impressive as far as it goes for portability however on the other side, we have C.