Skip to content

Commit

Permalink
Add notes about target-cpu to README
Browse files Browse the repository at this point in the history
  • Loading branch information
jhorstmann committed Jun 12, 2022
1 parent 8e28308 commit 40eb503
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arrow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ cargo run --example read_csv
```

[arrow]: https://arrow.apache.org/


## Performance

Most of the compute kernels benefit a lot from being optimized for a specific CPU target.
This is especially so on x86-64 since without specifying a target the compiler can only assume support for SSE2 vector instructions.
One of the following values as `-Ctarget-cpu=value` in `RUSTFLAGS` can therefore improve performance significantly:

- `native`: Target the exact features of the cpu that the build is running on.
This should give the best performance when building and running locally, but should be used carefully for example when building in a CI pipeline or when shipping pre-compiled software.
- `x86-64-v3`: Includes AVX2 support and is close to the intel `haswell` architecture released in 2013 and should be supported by any recent Intel or Amd cpu.
- `x86-64-v4`: Includes AVX512 support available on intel `skylake` server and `icelake`/`tigerlake`/`rocketlake` laptop and desktop processors.

These flags should be used in addition to the `simd` feature, since they will also affect the code generated by the simd library.

0 comments on commit 40eb503

Please sign in to comment.