From b8e8a1761bd368bb8dc61b931ab9d78751ec0788 Mon Sep 17 00:00:00 2001 From: Tom McKeesick Date: Sun, 27 Mar 2022 19:49:40 +1100 Subject: [PATCH 1/2] Include arm64 as a build option for OSX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit increases speed on m1 macs around 2x ``` Benchmark 1: echo f | ./pokesay-darwin-arm64 Time (mean ± σ): 13.3 ms ± 0.7 ms [User: 10.2 ms, System: 6.6 ms] Range (min … max): 12.4 ms … 15.6 ms 143 runs Benchmark 1: echo f | ./pokesay-darwin-amd64 Time (mean ± σ): 40.7 ms ± 2.7 ms [User: 28.9 ms, System: 26.0 ms] Range (min … max): 32.2 ms … 46.6 ms 67 runs ``` --- build/Dockerfile | 1 + build/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/build/Dockerfile b/build/Dockerfile index 446b8b8a..210e4da6 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -35,6 +35,7 @@ RUN go build src/pokedex.go && \ ./pokedex -from /tmp/cows/ -to build/cows.gob RUN echo "building darwin / amd64" && GOOS=darwin GOARCH=amd64 go build -o pokesay-darwin-amd64 pokesay.go && \ + echo "building darwin / arm64" && GOOS=darwin GOARCH=arm64 go build -o pokesay-darwin-arm64 pokesay.go && \ echo "building linux / amd64" && GOOS=linux GOARCH=amd64 go build -o pokesay-linux-amd64 pokesay.go && \ echo "building windows / amd64" && GOOS=windows GOARCH=amd64 go build -o pokesay-windows-amd64.exe pokesay.go && \ echo "building android / arm64" && GOOS=android GOARCH=arm64 go build -o pokesay-android-arm64 pokesay.go diff --git a/build/Makefile b/build/Makefile index d7065f32..5efd7798 100644 --- a/build/Makefile +++ b/build/Makefile @@ -29,6 +29,7 @@ build/release: @docker create --name pokesay pokesay-go:latest docker cp pokesay:/usr/local/src/pokesay-linux-amd64 . docker cp pokesay:/usr/local/src/pokesay-darwin-amd64 . + docker cp pokesay:/usr/local/src/pokesay-darwin-arm64 . docker cp pokesay:/usr/local/src/pokesay-windows-amd64.exe . docker cp pokesay:/usr/local/src/pokesay-android-arm64 . @docker rm -f pokesay From 77f2bb72d7dd95d90fa1fe3a89ca4a64568e7f2c Mon Sep 17 00:00:00 2001 From: Tom McKeesick Date: Sun, 27 Mar 2022 19:52:34 +1100 Subject: [PATCH 2/2] Add mac m1 to install commands --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index abd3b631..910078f9 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ A (much) faster go version of tmck-code/pokesay ```shell bash -c "$(curl https://raw.githubusercontent.com/tmck-code/pokesay-go/master/scripts/install.sh)" bash darwin amd64 ``` +- OSX / darwin (M1) + ```shell + bash -c "$(curl https://raw.githubusercontent.com/tmck-code/pokesay-go/master/scripts/install.sh)" bash darwin arm64 + ``` - Linux x64 ```shell bash -c "$(curl https://raw.githubusercontent.com/tmck-code/pokesay-go/master/scripts/install.sh)" bash linux amd64