Artifact c5d4bb319f11703f078435b06e6d5e614187b0f4d48772c2d0f184f9b520443c:
- File
examples/tinygo/README.md
— part of check-in
[313f64a89e]
at
2026-10-23 21:44:00
on branch main
— docs: quote the TinyGo size CI measures
The Build (tinygo) job builds examples/tinygo on every change, so its size (3.52 MB raw, 1.26 MB gzipped) is the one the site quotes; the README keeps the macOS measurements beside it. (user: [email protected], size: 1417) [annotate] [blame] [check-ins using] [more...]
tinygo (js/wasm)
The whole public API, including the HTTP sync client and signing, compiled
with TinyGo for the wasm (js) target.
tinygo build -target=wasm -no-debug -opt=z -stack-size=1MB -o libfossil.wasm ./examples/tinygo/
wasm-opt -Oz --detect-features --strip-debug --strip-producers libfossil.wasm -o libfossil.wasm
-stack-size=1MB: TinyGo's default goroutine stack is too small for
go-libfossil's deeper paths.
Measured for this program with TinyGo 0.43.0: the first row is the
Build (tinygo) CI job; the others are macOS (Go 1.27.3, LLVM 22,
Binaryen 133).
| Build | Raw | gzip -9 |
|---|---|---|
| TinyGo, as CI builds it (Linux release, its own wasm-opt) | 3.52 MB | 1.26 MB |
TinyGo, then wasm-opt -Oz |
3.83 MB | 1.40 MB |
| TinyGo | 4.02 MB | 1.44 MB |
Standard Go, GOOS=js GOARCH=wasm -ldflags='-s -w' |
16.1 MB | 4.06 MB |
A program that leaves out sync (no net/http, no TLS) is smaller.
No SQLite driver is imported here. A TinyGo host registers a
database/sql driver over its own SQLite. The ncruces driver runs SQLite
as an embedded wasm module and is for standard Go builds; the modernc
driver has no wasm build.
Under TinyGo two things behave differently, because TinyGo's standard library lacks what they use: a sync redirect ends the request with an error instead of being followed, and DNS failures are not classified as transient.