11# 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 )
22
3- Go library providing algorithms optimized to leverage the characteristics of
4- modern CPUs .
3+ Go library providing algorithms that use the full power of modern CPUs to get
4+ the best performance .
55
66## Motivation
77
8- With the development of Cloud technologies, access to large scale compute
9- capacity has never been easier, and running distributed systems deployed across
10- dozens or sometimes hundreds of CPUs has become common practice. As a side
11- effect of being provided seemingly unlimited (but somewhat expensive) compute
12- capacity, software engineers are now in direct connections with the economical
13- and environmental impact of running the software they develop in production;
14- performance and efficiency of our programs matters today more than it has ever
15- before.
8+ The cloud makes it easier than ever to access large scale compute capacity,
9+ and it's become common to run distributed systems deployed across dozens or
10+ sometimes hundreds of CPUs. Because projects run on so many cores now, program
11+ performance and efficiency matters more today than it has ever before.
1612
17- Modern CPUs are complex machines with performance characteristic that may
13+ Modern CPUs are complex machines with performance characteristics that may
1814vary by orders of magnitude depending on how they are used. Features like
1915branch prediction, instruction reordering, pipelining, or caching are all
2016input variables that determine the compute throughput that a CPU can achieve.
@@ -102,7 +98,7 @@ Sort16/1000000 59.4MB/s ± 2% 351.2MB/s ± 3% +491.24% (p=0.008 n=5+5)
10298
10399## Maintenance
104100
105- Generation of the assembly code is managed with [ AVO] ( https://github.com/mmcloughlin/avo ) ,
101+ The assembly code is generated with [ AVO] ( https://github.com/mmcloughlin/avo ) ,
106102and orchestrated by a Makefile which helps maintainers rebuild the assembly
107103source code when the AVO files are modified.
108104
@@ -121,6 +117,17 @@ stable APIs on the main package, breaking changes may be introduced on the
121117` build ` package more often, as it is intended to be ground for more experimental
122118constructs in the project.
123119
120+ ### Requirements
121+
122+ Some libraries have custom purpose code for both amd64 and arm64. Others (qsort)
123+ have only amd64. Search for a ` .s ` file matching your architecture to be sure
124+ you are using the assembler optimized library instructions.
125+
126+ The Go code requires Go 1.17 or above. These versions contain significant
127+ performance improvements compared to previous Go versions.
128+
129+ ` asm ` version v1.1.5 and earlier maintain compatibility with Go 1.16.
130+
124131### purego
125132
126133Programs in the ` build ` module should add the following declaration:
@@ -132,7 +139,7 @@ func init() {
132139```
133140
134141It instructs AVO to inject the ` !purego ` tag in the generated files, allowing
135- compilation of the libraries without any assembly optimizations with a build
142+ the libraries to be compiled without any assembly optimizations with a build
136143command such as:
137144
138145```
@@ -141,4 +148,3 @@ go build -tags purego ...
141148
142149This is mainly useful to compare the impact of using the assembly optimized
143150versions instead of the simpler Go-only implementations.
144-
0 commit comments