Repository navigation
Replies: 1 comment
|
No I'm not doing anything on top of Binaryen. I don't think SQLite has any small enough “hot spots” to be worth that. A profile of SQLite will surface the VDBE interpreter loop, which is probably the largest function in the library. I'm somewhat likely to experiment with supporting Wasm SIMD using the SIMD experiment in Go 1.27. Otherwise, I don't expect to improve the Wasm translation significantly. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I have a question about the optimization workflow used for
go-sqlite3.Do you use any kind of automated profiling + aggressive optimization of hot paths with an LLM on top of Binaryen?
At first glance, this approach may seem prohibitively expensive, but I think the economics are actually quite different. The expensive part only needs to be done once per major upstream release. When a new minor upstream version comes out, you can simply show the model the diff from the previous optimization and say: "Optimize the new version in the same way!" Rewriting code based on an existing reference is something that doesn't require a top-tier LLM.
I experimented with a similar approach in my wasm2go zlib port. I needed compression to produce a bit-for-bit compatible stream with the original C zlib, so replacing the algorithm with a different implementation wasn't an option.
I aggressively optimized only the compression path, since I didn't need decompression. I asked LLM to optimize like top demo scene hacker. I didn't even need the latest models like Opus; the Gemini 3 series handled it perfectly. The resulting
zlib4gocompression performance ended up even slightly faster than the original C zlib in my benchmark. The project is here:https://github.com/unxed/zlib4go
The repository also contains the benchmark results and the generated Go/assembly implementation.
I'm curious whether you've considered this kind of workflow for
go-sqlite3, or perhaps are already using something similar.PS: I'm using your excellent lib in
https://github.com/unxed/tar
https://github.com/unxed/zipper
https://github.com/unxed/f4
Great job, thanks!
All reactions