diff --git a/.github/memci.json b/.github/memci.json new file mode 100644 index 0000000..249a3d4 --- /dev/null +++ b/.github/memci.json @@ -0,0 +1,12 @@ +[ + { + "name": "bindiff", + "build": "go build -trimpath -buildvcs=false -o bindiff.elf ./cmd/bindiff", + "elf": "bindiff.elf" + }, + { + "name": "picobin", + "build": "go build -trimpath -buildvcs=false -o picobin.elf ./cmd/picobin", + "elf": "picobin.elf" + } +] diff --git a/.github/workflows/memci.yml b/.github/workflows/memci.yml index 33f5f07..fcee317 100644 --- a/.github/workflows/memci.yml +++ b/.github/workflows/memci.yml @@ -17,17 +17,14 @@ jobs: - uses: actions/setup-go@v6 with: - # TinyGo 0.42 builds with Go 1.25 through 1.27 and refuses anything - # outside that window, so the two versions below move together. go-version: "1.26" - - uses: acifani/setup-tinygo@v2 - with: - tinygo-version: "0.42.0" + # Both binaries here are host tools. A TinyGo target would need + # acifani/setup-tinygo installed above and a build command naming it. - uses: soypat/memci@main with: - args: -targets ./cmd/... -kind package + args: -kind package # bindiff lives in this repo, so measure with the copy under test # rather than installing a published one. bindiff: go run ./cmd/bindiff - tinygo: tinygo + targets: .github/memci.json diff --git a/.gitignore b/.gitignore index d6660bc..d8c5f04 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,8 @@ local *.tsv *.dat *.json +# memci's build list is configuration, not data. +!.github/memci.json *.xlsx *.xls *.zip diff --git a/build/xdwarf/bench_test.go b/build/xdwarf/bench_test.go index cf0ac42..dbd92a4 100644 --- a/build/xdwarf/bench_test.go +++ b/build/xdwarf/bench_test.go @@ -28,10 +28,10 @@ func BenchmarkLineRowsXdwarf(b *testing.B) { // once the tables have grown to their high-water mark. var u xdwarf.LineUnit aux := make([]byte, benchAux) - var nameBuf []byte + nameBuf := make([]byte, 0, benchAux) b.ReportAllocs() b.ResetTimer() - for i := 0; i < b.N; i++ { + for b.Loop() { var rows int for off := int64(0); off < size; { next, err := xdwarf.DecodeLineUnit(&u, sec, off, size, aux) @@ -68,7 +68,7 @@ func BenchmarkLineRowsStdlib(b *testing.B) { } b.ReportAllocs() b.ResetTimer() - for i := 0; i < b.N; i++ { + for b.Loop() { d, err := ef.DWARF() if err != nil { b.Fatal(err)