Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github: update to Go 1.18.1 #76

Merged
merged 2 commits into from Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/go.yml
Expand Up @@ -7,8 +7,8 @@ jobs:
strategy:
matrix:
go:
- 1.16
- 1.17
- 1.17.x
- 1.18.x
os:
- ubuntu-latest

Expand Down Expand Up @@ -43,12 +43,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
go-version: 1.18.x

- name: Generate
run: make --always-make build

- name: Git Status
- name: Ensure generated assembler code is up to date
run: |
git diff
test -z "$(git status --porcelain)"
go install github.com/kevinburke/differ@1.2
differ make --always-make build
34 changes: 20 additions & 14 deletions README.md
@@ -1,20 +1,16 @@
# asm ![build status](https://github.com/segmentio/asm/actions/workflows/go.yml/badge.svg) [![GoDoc](https://godoc.org/github.com/segmentio/asm?status.svg)](https://godoc.org/github.com/segmentio/asm)

Go library providing algorithms optimized to leverage the characteristics of
modern CPUs.
Go library providing algorithms that use the full power of modern CPUs to get
the best performance.

## Motivation

With the development of Cloud technologies, access to large scale compute
capacity has never been easier, and running distributed systems deployed across
dozens or sometimes hundreds of CPUs has become common practice. As a side
effect of being provided seemingly unlimited (but somewhat expensive) compute
capacity, software engineers are now in direct connections with the economical
and environmental impact of running the software they develop in production;
performance and efficiency of our programs matters today more than it has ever
before.
The cloud makes it easier than ever to access large scale compute capacity,
and it's become common to run distributed systems deployed across dozens or
sometimes hundreds of CPUs. Because projects run on so many cores now, program
performance and efficiency matters more today than it has ever before.

Modern CPUs are complex machines with performance characteristic that may
Modern CPUs are complex machines with performance characteristics that may
vary by orders of magnitude depending on how they are used. Features like
branch prediction, instruction reordering, pipelining, or caching are all
input variables that determine the compute throughput that a CPU can achieve.
Expand Down Expand Up @@ -102,7 +98,7 @@ Sort16/1000000 59.4MB/s ± 2% 351.2MB/s ± 3% +491.24% (p=0.008 n=5+5)

## Maintenance

Generation of the assembly code is managed with [AVO](https://github.com/mmcloughlin/avo),
The assembly code is generated with [AVO](https://github.com/mmcloughlin/avo),
and orchestrated by a Makefile which helps maintainers rebuild the assembly
source code when the AVO files are modified.

Expand All @@ -121,6 +117,17 @@ stable APIs on the main package, breaking changes may be introduced on the
`build` package more often, as it is intended to be ground for more experimental
constructs in the project.

### Requirements

Some libraries have custom purpose code for both amd64 and arm64. Others (qsort)
have only amd64. Search for a `.s` file matching your architecture to be sure
you are using the assembler optimized library instructions.

The Go code requires Go 1.17 or above. These versions contain significant
performance improvements compared to previous Go versions.

`asm` version v1.1.5 and earlier maintain compatibility with Go 1.16.

### purego

Programs in the `build` module should add the following declaration:
Expand All @@ -132,7 +139,7 @@ func init() {
```

It instructs AVO to inject the `!purego` tag in the generated files, allowing
compilation of the libraries without any assembly optimizations with a build
the libraries to be compiled without any assembly optimizations with a build
command such as:

```
Expand All @@ -141,4 +148,3 @@ go build -tags purego ...

This is mainly useful to compare the impact of using the assembly optimized
versions instead of the simpler Go-only implementations.

1 change: 0 additions & 1 deletion ascii/equal_fold_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ascii/equal_fold_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run equal_fold_asm.go -pkg ascii -out ../ascii/equal_fold_amd64.s -stubs ../ascii/equal_fold_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion ascii/valid_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ascii/valid_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run valid_asm.go -pkg ascii -out ../ascii/valid_amd64.s -stubs ../ascii/valid_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion ascii/valid_print_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ascii/valid_print_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run valid_print_asm.go -pkg ascii -out ../ascii/valid_print_amd64.s -stubs ../ascii/valid_print_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion base64/decode_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion base64/decode_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run decode_asm.go -pkg base64 -out ../base64/decode_amd64.s -stubs ../base64/decode_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion base64/encode_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion base64/encode_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run encode_asm.go -pkg base64 -out ../base64/encode_amd64.s -stubs ../base64/encode_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion bswap/swap64_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bswap/swap64_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run swap64_asm.go -pkg bswap -out ../bswap/swap64_amd64.s -stubs ../bswap/swap64_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion keyset/keyset_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion keyset/keyset_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run keyset_asm.go -pkg keyset -out ../keyset/keyset_amd64.s -stubs ../keyset/keyset_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion mem/blend_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mem/blend_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run blend_asm.go -pkg mem -out ../mem/blend_amd64.s -stubs ../mem/blend_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion mem/contains_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mem/contains_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run contains_asm.go -pkg mem -out ../mem/contains_amd64.s -stubs ../mem/contains_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion mem/copy_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mem/copy_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run copy_asm.go -pkg mem -out ../mem/copy_amd64.s -stubs ../mem/copy_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion mem/count_pair_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mem/count_pair_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run count_pair_asm.go -pkg mem -out ../mem/count_pair_amd64.s -stubs ../mem/count_pair_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion mem/index_pair_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mem/index_pair_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run index_pair_asm.go -pkg mem -out ../mem/index_pair_amd64.s -stubs ../mem/index_pair_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion mem/mask_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mem/mask_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run mask_asm.go -pkg mem -out ../mem/mask_amd64.s -stubs ../mem/mask_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion qsort/sort_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion qsort/sort_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run sort_asm.go -pkg qsort -out ../qsort/sort_amd64.s -stubs ../qsort/sort_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion slices/sums_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion slices/sums_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run sums_asm.go -pkg slices -out ../slices/sums_amd64.s -stubs ../slices/sums_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion sortedset/dedupe_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sortedset/dedupe_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run dedupe_asm.go -pkg sortedset -out ../sortedset/dedupe_amd64.s -stubs ../sortedset/dedupe_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion sortedset/intersect16_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sortedset/intersect16_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run intersect16_asm.go -pkg sortedset -out ../sortedset/intersect16_amd64.s -stubs ../sortedset/intersect16_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion sortedset/union16_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sortedset/union16_amd64.s
@@ -1,7 +1,6 @@
// Code generated by command: go run union16_asm.go -pkg sortedset -out ../sortedset/union16_amd64.s -stubs ../sortedset/union16_amd64.go. DO NOT EDIT.

//go:build !purego
// +build !purego

#include "textflag.h"

Expand Down
1 change: 0 additions & 1 deletion utf8/valid_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.