Skip to content

Commit

Permalink
docs(README): mention that one can limit the number of CPUs
Browse files Browse the repository at this point in the history
See #6
  • Loading branch information
ronnychevalier committed Dec 18, 2023
1 parent 79035e0 commit 28beed6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For example, for `x86_64` you could add:

```toml
[package.metadata.multivers.x86_64]
cpus = ["generic", "alderlake", "skylake", "sandybridge", "ivybridge"]
cpus = ["x86-64", "x86-64-v2", "x86-64-v3", "x86-64-v4", "raptorlake"]
```

After building the different versions, it computes a hash of each version and it filters out the duplicates.
Expand Down Expand Up @@ -77,6 +77,14 @@ panic = "abort"
lto = "thin"
```

To reduce the total build time, it might be best to limit the set of CPUs for which the project will be built.
For instance, you can add to your `Cargo.toml` the following section if you build for `x86_64`:

```toml
[package.metadata.multivers.x86_64]
cpus = ["x86-64", "x86-64-v2", "x86-64-v3", "x86-64-v4"]
```

## Related Work

- If you want to apply this approach only at the function level, take a look at the [multiversion](https://crates.io/crates/multiversion) crate.
Expand Down

0 comments on commit 28beed6

Please sign in to comment.