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

Tweak release profile. #213

Merged
merged 1 commit into from
Nov 15, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ str_to_string = "deny"
insta.opt-level = 3
similar.opt-level = 3

[profile.release]
lto = "fat"
codegen-units = 1

[profile.profiling]
inherits = "release"
debug = true
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,29 +490,29 @@ In a router of 130 routes, benchmark matching 4 paths.

| Library | Time | Alloc Count | Alloc Size | Dealloc Count | Dealloc Size |
|:-----------------|----------:|------------:|-----------:|--------------:|-------------:|
| wayfind | 386.64 ns | 4 | 265 B | 4 | 265 B |
| matchit | 477.13 ns | 4 | 416 B | 4 | 448 B |
| xitca-router | 557.61 ns | 7 | 800 B | 7 | 832 B |
| path-tree | 574.68 ns | 4 | 416 B | 4 | 448 B |
| ntex-router | 1.7266 µs | 18 | 1.248 KB | 18 | 1.28 KB |
| route-recognizer | 4.7007 µs | 160 | 8.505 KB | 160 | 8.537 KB |
| routefinder | 6.4120 µs | 67 | 5.024 KB | 67 | 5.056 KB |
| actix-router | 20.772 µs | 214 | 13.93 KB | 214 | 13.96 KB |
| wayfind | 384.74 ns | 4 | 265 B | 4 | 265 B |
| matchit | 440.53 ns | 4 | 416 B | 4 | 448 B |
| path-tree | 517.08 ns | 4 | 416 B | 4 | 448 B |
| xitca-router | 527.06 ns | 7 | 800 B | 7 | 832 B |
| ntex-router | 1.9893 µs | 18 | 1.248 KB | 18 | 1.28 KB |
| route-recognizer | 4.1686 µs | 160 | 8.505 KB | 160 | 8.537 KB |
| routefinder | 5.4922 µs | 67 | 5.024 KB | 67 | 5.056 KB |
| actix-router | 20.502 µs | 214 | 13.93 KB | 214 | 13.96 KB |

#### `path-tree` inspired benches

In a router of 320 routes, benchmark matching 80 paths.

| Library | Time | Alloc Count | Alloc Size | Dealloc Count | Dealloc Size |
|:-----------------|----------:|------------:|-----------:|--------------:|-------------:|
| wayfind | 5.7497 µs | 59 | 2.567 KB | 59 | 2.567 KB |
| path-tree | 8.9033 µs | 59 | 7.447 KB | 59 | 7.47 KB |
| matchit | 9.0204 µs | 140 | 17.81 KB | 140 | 17.83 KB |
| xitca-router | 10.782 µs | 209 | 25.51 KB | 209 | 25.53 KB |
| ntex-router | 29.200 µs | 201 | 19.54 KB | 201 | 19.56 KB |
| route-recognizer | 90.893 µs | 2872 | 191.7 KB | 2872 | 204.8 KB |
| routefinder | 100.36 µs | 525 | 48.4 KB | 525 | 48.43 KB |
| actix-router | 175.23 µs | 2201 | 128.8 KB | 2201 | 128.8 KB |
| wayfind | 5.5736 µs | 59 | 2.567 KB | 59 | 2.567 KB |
| path-tree | 7.9324 µs | 59 | 7.447 KB | 59 | 7.47 KB |
| matchit | 8.5009 µs | 140 | 17.81 KB | 140 | 17.83 KB |
| xitca-router | 10.296 µs | 209 | 25.51 KB | 209 | 25.53 KB |
| ntex-router | 33.301 µs | 201 | 19.54 KB | 201 | 19.56 KB |
| routefinder | 81.328 µs | 525 | 48.4 KB | 525 | 48.43 KB |
| route-recognizer | 86.906 µs | 2872 | 191.7 KB | 2872 | 204.8 KB |
| actix-router | 172.28 µs | 2201 | 128.8 KB | 2201 | 128.8 KB |

## License

Expand Down
3 changes: 3 additions & 0 deletions nix/vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@
defaultPackages = with pkgs; [
gcc
(rust-bin.stable."1.82.0".minimal)
sccache
gnuplot
];

variables = {
RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache";
RUSTFLAGS = "-C target-cpu=native";
CARGO_INCREMENTAL = "0";
CARGO_TARGET_DIR = "/tmp";
};

Expand Down