Skip to content

Split Components iterator to prefixed and non-prefixed versions and optimize Components for non-prefix path based platforms - #156496

Open
asder8215 wants to merge 13 commits into
rust-lang:mainfrom
asder8215:components_rewrite
Open

Split Components iterator to prefixed and non-prefixed versions and optimize Components for non-prefix path based platforms#156496
asder8215 wants to merge 13 commits into
rust-lang:mainfrom
asder8215:components_rewrite

Conversation

@asder8215

@asder8215 asder8215 commented May 12, 2026

Copy link
Copy Markdown
Contributor

View all comments

This PR entirely changes how Components<'_> is implemented. Currently, the Components<'_> iterator 'consumes' components through mutating its path field to a subslice that presents the left over unconsumed path components (this consumed path component is what's returned in Components::next or Components::next_back). However, this PR keeps the path field alive/unmodified and uses front and back indexing strategy to extract consumed/unconsumed components. This Components<'_> implementation still uses a subslicing approach similar to the original implementation, but it's highly optimized for non-Windows platform, given that there's no Prefix<'_> components to check with.

Ideally, at least from a few benchmarking test I've done locally, this Components<'_> implementation should perform similarly with the original one when it comes to Components::next/Components ordering comparisons (the original one was already highly optimized as is). Where this non-Windows implementation shine though is improving Components::as_path (as a result certain things benefit from this like Ancestors iterator, std::fs::create_dir_all, etc.) and Components::next_back (and as a result Path equality).

There are a lot of different things I've done to make sure that Components equality is improved dramatically. For example, just like what Components comparison does with checking if we see a mismatched byte in the forward direction and setting our Components iterator to the nearest separator, we do the same thing with Components equality in the opposite direction (this actually is one of the significant reason why this implementation of Components equality is really, really faster now). Additionally, there are other optimizations I do here, like doing less boolean checks or usize comparisons within Components::next_back and normalizing any separator/curr directory bytes upfront (the original implementation had a lot of conditional checks that could be way more simplified; the prefix checking also didn't benefit non-Windows platform). With the way I have State enum implemented in this Components iterator, I can do other small optimizations like checking for empty paths, so that I can return true or false immediately.

Because the implementation I'm going for is specific to non-Windows/non-prefix-supporting platforms, I chose to split the Components iterator implementation to two different version that is re-exported accordingly to individual platforms (this leads to HAS_PREFIXES constant being redundant and unnecessary). I'm open to discussion on how to organize the code here better, naming stuff, etc. Some prefix-specific things have been refactored to be exclusively on platforms that utilize prefix components.

So far, I've been benchmarking it locally. I formerly did it with Criterion, but now I've just been benchmarking manually through hyperfine. What I've been testing was how fast can this implementation ofComponents::next/Components::next_back run paths like "a1..aN/a1..aN" vs "b/a1..aN/a1..aN/" (where N is some number of a's I put for each component, and you can assume that there are some X path components in the path); I also played around with the mismatching component placed at the end of the path versus beginning, and benchmarked running the same path equality/comparisons 10000 times to see the result cumulatively. You can try hyperfining the code in this repo; I'll get around to consolidating those benchmarks in Criterion a bit later and then posting results in the comments below.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 12, 2026
@rustbot

rustbot commented May 12, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates

@rustbot

This comment has been minimized.

@asder8215
asder8215 force-pushed the components_rewrite branch from 1627e2f to 33e69e1 Compare May 12, 2026 09:09
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@asder8215
asder8215 force-pushed the components_rewrite branch from 33e69e1 to ed9d33d Compare May 12, 2026 17:05
@rust-log-analyzer

This comment has been minimized.

@asder8215
asder8215 force-pushed the components_rewrite branch from ed9d33d to 0b0f84c Compare May 12, 2026 17:19
@rust-log-analyzer

This comment has been minimized.

@asder8215
asder8215 force-pushed the components_rewrite branch from 0b0f84c to 8ed33ea Compare May 12, 2026 22:05
@asder8215

This comment was marked as outdated.

@asder8215
asder8215 force-pushed the components_rewrite branch from 2151b8f to 83cdbed Compare May 13, 2026 22:21
@asder8215

This comment was marked as outdated.

@asder8215
asder8215 force-pushed the components_rewrite branch from 83cdbed to 3921fff Compare May 15, 2026 00:30
@asder8215
asder8215 marked this pull request as draft May 16, 2026 12:22
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 16, 2026
@asder8215
asder8215 force-pushed the components_rewrite branch from 0a25dda to 92e0132 Compare May 17, 2026 16:09
@asder8215

asder8215 commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

New benchmarking results. You can see what the benchmark code looks like here and run it yourself to see if there are any difference in measurements on your end:

This is the measurement of the current implementation of Components<'_> (without black box):

Std Components (No BB)  time:   [21.546 µs 21.800 µs 22.096 µs]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

Std Components Next (No BB)
                        time:   [20.434 µs 20.482 µs 20.538 µs]
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe

Std Components Next Back (No BB)
                        time:   [38.367 µs 38.757 µs 39.199 µs]
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe

Std Path Iter (No BB)   time:   [21.547 µs 21.730 µs 21.921 µs]

Std As Path Iter (No BB)
                        time:   [87.680 µs 88.439 µs 89.231 µs]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe

Std Eq Comps (No BB)    time:   [591.21 ns 593.35 ns 595.82 ns]
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) low severe
  3 (3.00%) low mild
  7 (7.00%) high mild
  5 (5.00%) high severe

Std Uneq Comps (No BB)  time:   [60.953 ns 61.419 ns 61.911 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

Std Uneq 2 Comps (No BB)
                        time:   [75.454 µs 75.734 µs 76.027 µs]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

Std Compare Comps (No BB)
                        time:   [46.182 µs 46.621 µs 47.192 µs]
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe

Std Compare Uneq Comps (No BB)
                        time:   [46.679 µs 46.980 µs 47.291 µs]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe

Std Compare Uneq 2 Comps (No BB)
                        time:   [41.480 ns 41.827 ns 42.160 ns]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

This is the measurement of the new implementation of Components<'_> I'm working on (without black box):

Components Rewrite (No BB)
                        time:   [24.982 µs 25.267 µs 25.570 µs]

Components Next Rewrite (No BB)
                        time:   [24.388 µs 24.655 µs 24.937 µs]
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high mild

Components Next Back Rewrite (No BB)
                        time:   [18.184 µs 18.567 µs 19.034 µs]
Found 16 outliers among 100 measurements (16.00%)
  1 (1.00%) high mild
  15 (15.00%) high severe

Path Iter Rewrite (No BB)
                        time:   [23.485 µs 23.659 µs 23.829 µs]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

As Path Iter Rewrite (No BB)
                        time:   [22.936 µs 23.066 µs 23.208 µs]
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

Eq Comps Rewrite (No BB)
                        time:   [605.12 ns 608.83 ns 612.98 ns]
Found 11 outliers among 100 measurements (11.00%)
  1 (1.00%) low mild
  7 (7.00%) high mild
  3 (3.00%) high severe

Uneq Comps Rewrite (No BB)
                        time:   [31.799 ns 32.108 ns 32.433 ns]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild

Uneq Comps 2 Rewrite (No BB)
                        time:   [47.091 µs 48.186 µs 49.085 µs]

Compare Comps Rewrite (No BB)
                        time:   [50.234 µs 50.725 µs 51.254 µs]
Found 10 outliers among 100 measurements (10.00%)
  9 (9.00%) high mild
  1 (1.00%) high severe

Compare Uneq Comps Rewrite (No BB)
                        time:   [49.262 µs 49.631 µs 50.067 µs]
Found 16 outliers among 100 measurements (16.00%)
  4 (4.00%) high mild
  12 (12.00%) high severe

Compare Uneq Comps 2 Rewrite (No BB)
                        time:   [43.397 ns 43.767 ns 44.171 ns]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild

Edit: Updated Components::as_path to match on Option<FirstComponent>/self.first_comp instead of using if let Some(_) = self.first_comp and matching on that, benchmarking for this PR Components<'_> has been updated as a result. Everything else is unaffected by this change.

@asder8215

asder8215 commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Here are the benchmark results with black box:

From current Components<'_> implementation:

Std Components          time:   [20.947 µs 21.010 µs 21.084 µs]
Found 8 outliers among 100 measurements (8.00%)
  4 (4.00%) high mild
  4 (4.00%) high severe

Std Components Next     time:   [20.967 µs 20.993 µs 21.021 µs]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

Std Components Next Back
                        time:   [35.715 µs 35.802 µs 35.925 µs]
Found 20 outliers among 100 measurements (20.00%)
  6 (6.00%) high mild
  14 (14.00%) high severe

Std Path Iter           time:   [20.883 µs 20.992 µs 21.152 µs]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe

Std As Path Iter        time:   [80.673 µs 80.935 µs 81.261 µs]
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe

Std Eq Comps            time:   [589.43 ns 593.36 ns 597.88 ns]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low severe
  2 (2.00%) low mild
  1 (1.00%) high severe

Std Uneq Comps          time:   [63.919 ns 64.262 ns 64.765 ns]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe

Std Uneq 2 Comps        time:   [75.284 µs 75.939 µs 76.599 µs]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe

From this Components<'_> implementation PR:

Components Rewrite      time:   [24.190 µs 24.425 µs 24.687 µs]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

Components Next Rewrite time:   [24.230 µs 24.550 µs 24.889 µs]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

Components Next Back Rewrite
                        time:   [17.339 µs 17.488 µs 17.655 µs]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

Path Iter Rewrite       time:   [23.845 µs 23.996 µs 24.154 µs]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

As Path Iter Rewrite    time:   [22.431 µs 22.676 µs 23.010 µs]
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe

Eq Comps Rewrite        time:   [586.16 ns 588.10 ns 590.14 ns]

Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe

Uneq Comps Rewrite      time:   [31.733 ns 32.023 ns 32.378 ns]

Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe

Uneq 2 Comps Rewrite    time:   [36.318 µs 36.574 µs 36.913 µs]
Found 23 outliers among 100 measurements (23.00%)
  23 (23.00%) high severe

Edit: Updated Components::as_path to match on Option<FirstComponent>/self.first_comp instead of using if let Some(_) = self.first_comp and matching on that, benchmarking for this PR Components<'_> has been updated as a result. Everything else is unaffected by this change.

Edit 2: Took off Path ordering benchmark here since it was incorrect see below to see corrected path ordering benchmarks.

@asder8215
asder8215 force-pushed the components_rewrite branch from 92e0132 to 574d7f2 Compare May 17, 2026 18:41
@asder8215
asder8215 marked this pull request as ready for review May 17, 2026 18:59
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 17, 2026
@asder8215

asder8215 commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

I'm confident this code works (passed CI in previous run, the current amended commit change I made doesn't change logic, but makes the code written in a more idiomatic way).

In my opinion, the logic in this code should look more readable than how Component<'_> is currently written implemented as. From benchmarking, we can see that Components::next_back, Components::as_path, and in the cases where Components equality falls down to using Components::next_back (when they are unequal or equality can't be determine unless one/both Components<'_> are normalized), this PR implementation of Components<'_> is faster than how it's currently implemented as. The trade off is that this PR implementation of Components<'_> has a slight reduction in performance for Components::next and as a result Components<'_> comparison, but I would take this slight reduction in performance to make path equality faster.

@asder8215

asder8215 commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot label +I-libs-nominated

Since Components<'_> is pretty well-used in many other methods, I think this may need discussion from the libs team on whether the re-implementation of Components<'_> here is okay/valid to take over the current implementation (and the trade-off between faster Components::next_back with a slight reduction in performance in Components::next). I wasn't sure if this should be labeled as I-libs-api-nominated or not since it pertains to an existing stable feature than a new feature.

@rustbot rustbot added the I-libs-nominated Nominated for discussion during a libs team meeting. label May 19, 2026
#[derive(Clone)]
pub struct Components<'a> {
// The path left to parse components from
path: &'a [u8],

@asder8215 asder8215 Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to keep the field name as path to keep it consistent with the non-prefixed version of Components in case I want to refer to access the path field potentially outside of this file (e.g. for the PR I was working on in implementing DoubledEndedIterator on Ancestors iterator).

View changes since the review

@asder8215

Copy link
Copy Markdown
Contributor Author

@clarfonthey

I made one more optimization for the non-prefixed implementation of Components PartialOrd implementation. It should be able to compare the mismatched bytes directly (except for separator or cur dir bytes).

I'm hoping by this weekend, I'll have a chart with the performance difference between stdlib's current Components iterator and the new version of the iterator both in debug and release mode. This new version is more performant than the current one in release mode, but it's actually slower than the current one in debug mode, which makes me think that we should resort to compiling the prefixed version of Components on debug mode and the non-prefixed version on release mode. That should be possible, right?

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@clarfonthey

Copy link
Copy Markdown
Contributor

So, generally, being slower in debug mode is just a case of needing inline(always) or maybe adding some unsafe code to avoid extra checks. Personally, I would rather not entirely change how the code works depending on the profile since that is just going to cause problems long-term.

@asder8215

Copy link
Copy Markdown
Contributor Author

So, generally, being slower in debug mode is just a case of needing inline(always) or maybe adding some unsafe code to avoid extra checks.

I think the issue for why debug mode is slower for Components is because it relies heavily on simd/autovectorization optimizations that rustc/LLVM can make easily on iterators for u8 slices in release mode. In debug mode, I don't think iterator functions are given much optimizations, which affects nonprefixed Components code I wrote heavily because it utilizes more iterator functions for Components::next/Components::next_back and PartialEq/PartialOrd implementations. The prefixed/current Components tend to utilize more while loops for Components::next/Components::next_back (which is not to say while loops can't receive SIMD optimizations I just don't think the prefixed Components in this case did much) and didn't introduce some of the optimizations I made towards PartialOrd/PartialEq, so I don't think it received much optimizations on release mode anyways (can show you the perf difference between release and debug mode on prefixed Components).

Personally, I would rather not entirely change how the code works depending on the profile since that is just going to cause problems long-term.

I get where you're coming from. I'm unsure how to remove that debug perf slowdown though because I believe it boils down to a difference in the implementation and how the compiler optimizes/outputs code for the two.

…rtialOrd implementation for non-prefixed Components via directly comparing mismatched byte if it's not a separator byte or cur dir byte; refactor while loop code to use iter().enumerate().find() instead
…e conditional style code rather than match cases (degrades Components::next_back for some reason)
@asder8215

asder8215 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Disclaimer: I used Claude Sonnet 5 to parse through the raw Criterion measurement results I got from benchmarking Components iterator vs std Components iterator into well formatted md code tables (there's like 374 rows, so it would've taken me way longer to do this by hand or take some time to write a python script for this). I have cross-checked it with the raw Criterion results and it should be reflect the avg measurement results from what I got from Criterion. All benchmarking code is written myself, and I will explain the process of what I did to benchmark this below. You can find the benchmarking code in the components_subslice branch of my components_redesign repo (specifically in benches/components_slice.rs). The raw criterion results is also in the folder criterion_measurements/criterion_raw_report.

Note, I have only done the release optimizations benchmarking for Components (based around the code that is currently within nonprefixed_components.rs in this commit). I haven't done debug benchmarking yet because it takes a while for this to benchmarked completely (like ~1 hour and half), and I kept making tweaks into benchmarking the two iterators.

Right now my methodology is as follows:

  • Benchmarking this revolves around two different macros defined in Linux: PATH_MAX and NAME_MAX. PATH_MAX, which is 4096, is the number of bytes maximally allowed as a passed in path. NAME_MAX, which is 255, is the number of bytes maximally allowed as a file name. I use these two values to determine my stop points for experimenting a path and how large path component should be.
  • I experimented the following types:
    • Absolute (Abs) vs Relative (Rel) paths:
      • This subdivides down to long paths (PATH_MAX/(sizeof(path component) number of components) vs short paths (1 path component):
        • The size of each path components are further divided into the following numbers: 1, 3, 7, 15, 31, 63, 127, 255 (meant to do powers of 2s, like 1, 2, 4, 8, 16, 32, 64, 128, and then last one would be 255 instead of 256, but eh I did minus one from 2 onward).
        • We use the byte "a" in all the components (maybe might've been useful to use a random character? But I just chose to make this simpler.)
      • I also experimented on inconsistently sized components (paths with randomly sized components from 1-255 bytes), but it's only a long path right now (goes up to PATH_MAX, maybe a slightly a bit more due to a separator byte at the end). I randomly generated one such path and then chose that to be a fixed value, which you can see in the benchmark code (both as a relative path, and then made it an absolute path with a / byte at the start).
  • What I benchmarked were the following (both this Components and Std Components version):
    • Using Components::next to iterate through a given path
    • Using Components::next_back to iterate through a given path
    • Iterating through a given path with Components::next and using Components::as_path at every iteration
    • Components Equality
      • Equality on the path itself
      • Equality on the path vs same path with "b/" inserted at index 1
      • Equality on the path vs same path with "b/" inserted at path length / 2
      • Equality on the path vs same path with "b/" inserted at the end
    • Components Comparison:
      • > on the path itself
      • > on the path vs same path with "b/" inserted at index 1
      • > on the path vs same path with "b/" inserted at path length / 2
      • > on the path vs same path with "b/" inserted at the end
    • Internally, all of these functions run the same iteration/equality/comparison 100 times, to reduce noise from one iteration.

Looking back, there's a lot more I could've benchmarked and experimented with. For example, I could've varied the number of path components we had in total instead of doing minimum number of component (short path, 1 comp) and maximum number of path components (long path, PATH_MAX/sizeof(path components). I could've also done inconsistent path component size with varying number of path components instead of making it a long path. But benchmarking all those different types of combos/permutations likely would've taken a quarter/a third of my day.

Here are the release mode benchmarks:

Criterion Benchmark Results — Release Mode

Times shown are the Criterion point estimate (middle of the confidence interval).

Rel Short Path with 1 byte comps

Rel Short Path with 1 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 150.30 ns 692.22 ns
Components Next Back 213.24 ns 2.0604 µs
As Path Iter 151.50 ns 1.2996 µs
Components Equality Succeed 213.16 ns 447.73 ns
Components Equality Fail from Start 1.4272 µs 5.5853 µs
Components Equality Fail from Mid 1.4486 µs 5.5761 µs
Components Equality Fail from End 176.55 ns 4.8380 µs
Components Comparison Succeed 238.94 ns 1.0443 µs
Components Comparison Fail from Start 928.01 ns 2.0306 µs
Components Comparison Fail from Mid 926.85 ns 2.0413 µs
Components Comparison Fail from End 446.39 ns 2.1112 µs

Abs Short Path with 1 byte comps

Abs Short Path with 1 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 235.10 ns 803.25 ns
Components Next Back 254.25 ns 2.0692 µs
As Path Iter 379.65 ns 2.3733 µs
Components Equality Succeed 212.33 ns 469.48 ns
Components Equality Fail from Start 1.1683 µs 5.7783 µs
Components Equality Fail from Mid 1.1770 µs 5.7898 µs
Components Equality Fail from End 175.62 ns 4.6587 µs
Components Comparison Succeed 239.82 ns 1.0530 µs
Components Comparison Fail from Start 176.18 ns 2.2762 µs
Components Comparison Fail from Mid 175.72 ns 2.3005 µs
Components Comparison Fail from End 470.13 ns 2.1342 µs

Rel Short Path with 3 byte comps

Rel Short Path with 3 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 178.15 ns 708.02 ns
Components Next Back 255.50 ns 2.1033 µs
As Path Iter 229.14 ns 1.3100 µs
Components Equality Succeed 213.25 ns 497.48 ns
Components Equality Fail from Start 1.3781 µs 4.8276 µs
Components Equality Fail from Mid 1.3355 µs 4.8369 µs
Components Equality Fail from End 174.27 ns 4.8407 µs
Components Comparison Succeed 238.11 ns 1.0794 µs
Components Comparison Fail from Start 175.54 ns 2.2236 µs
Components Comparison Fail from Mid 211.06 ns 2.2195 µs
Components Comparison Fail from End 489.04 ns 2.1472 µs

Abs Short Path with 3 byte comps

Abs Short Path with 3 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 286.06 ns 844.27 ns
Components Next Back 312.47 ns 2.1178 µs
As Path Iter 458.45 ns 2.4933 µs
Components Equality Succeed 214.14 ns 450.59 ns
Components Equality Fail from Start 1.2224 µs 6.0054 µs
Components Equality Fail from Mid 1.4486 µs 4.6498 µs
Components Equality Fail from End 175.57 ns 4.6513 µs
Components Comparison Succeed 239.61 ns 1.0774 µs
Components Comparison Fail from Start 175.84 ns 2.3068 µs
Components Comparison Fail from Mid 211.28 ns 2.6324 µs
Components Comparison Fail from End 512.94 ns 2.1623 µs

Rel Short Path with 7 byte comps

Rel Short Path with 7 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 287.24 ns 847.16 ns
Components Next Back 351.97 ns 2.2549 µs
As Path Iter 311.34 ns 1.3521 µs
Components Equality Succeed 220.99 ns 448.33 ns
Components Equality Fail from Start 1.9210 µs 4.9177 µs
Components Equality Fail from Mid 1.7167 µs 4.8796 µs
Components Equality Fail from End 176.68 ns 4.8475 µs
Components Comparison Succeed 241.72 ns 1.1886 µs
Components Comparison Fail from Start 176.98 ns 2.4197 µs
Components Comparison Fail from Mid 257.44 ns 2.5978 µs
Components Comparison Fail from End 573.48 ns 2.2417 µs

Abs Short Path with 7 byte comps

Abs Short Path with 7 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 405.79 ns 978.68 ns
Components Next Back 415.18 ns 2.3949 µs
As Path Iter 593.99 ns 2.6666 µs
Components Equality Succeed 217.08 ns 469.64 ns
Components Equality Fail from Start 1.2523 µs 6.0919 µs
Components Equality Fail from Mid 1.8067 µs 4.7657 µs
Components Equality Fail from End 176.22 ns 4.6929 µs
Components Comparison Succeed 257.56 ns 1.2299 µs
Components Comparison Fail from Start 174.55 ns 2.3113 µs
Components Comparison Fail from Mid 257.29 ns 2.6431 µs
Components Comparison Fail from End 598.41 ns 2.1925 µs

Rel Short Path with 15 byte comps

Rel Short Path with 15 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 540.77 ns 1.1015 µs
Components Next Back 516.73 ns 2.5646 µs
As Path Iter 518.93 ns 1.7019 µs
Components Equality Succeed 212.67 ns 491.68 ns
Components Equality Fail from Start 3.0064 µs 5.1344 µs
Components Equality Fail from Mid 2.3225 µs 5.0224 µs
Components Equality Fail from End 176.07 ns 4.9686 µs
Components Comparison Succeed 241.62 ns 1.3409 µs
Components Comparison Fail from Start 174.67 ns 2.5471 µs
Components Comparison Fail from Mid 347.89 ns 3.1003 µs
Components Comparison Fail from End 746.27 ns 2.3902 µs

Abs Short Path with 15 byte comps

Abs Short Path with 15 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 624.06 ns 1.2482 µs
Components Next Back 694.50 ns 2.7686 µs
As Path Iter 801.48 ns 3.3591 µs
Components Equality Succeed 213.43 ns 468.78 ns
Components Equality Fail from Start 1.4778 µs 6.3396 µs
Components Equality Fail from Mid 2.5424 µs 4.9359 µs
Components Equality Fail from End 176.46 ns 4.8096 µs
Components Comparison Succeed 240.92 ns 1.3983 µs
Components Comparison Fail from Start 176.38 ns 2.7055 µs
Components Comparison Fail from Mid 347.10 ns 3.3399 µs
Components Comparison Fail from End 787.79 ns 2.3838 µs

Rel Short Path with 31 byte comps

Rel Short Path with 31 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 888.34 ns 1.4707 µs
Components Next Back 897.36 ns 3.1704 µs
As Path Iter 965.31 ns 2.0496 µs
Components Equality Succeed 235.71 ns 471.76 ns
Components Equality Fail from Start 5.0810 µs 5.5470 µs
Components Equality Fail from Mid 3.6229 µs 5.3528 µs
Components Equality Fail from End 174.66 ns 5.1818 µs
Components Comparison Succeed 261.03 ns 1.6304 µs
Components Comparison Fail from Start 176.30 ns 3.0795 µs
Components Comparison Fail from Mid 576.35 ns 4.0798 µs
Components Comparison Fail from End 1.1729 µs 2.6890 µs

Abs Short Path with 31 byte comps

Abs Short Path with 31 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 966.42 ns 1.4926 µs
Components Next Back 1.0409 µs 2.9864 µs
As Path Iter 1.1225 µs 4.4127 µs
Components Equality Succeed 233.02 ns 472.09 ns
Components Equality Fail from Start 2.2224 µs 6.7663 µs
Components Equality Fail from Mid 3.8091 µs 5.2059 µs
Components Equality Fail from End 177.51 ns 4.9979 µs
Components Comparison Succeed 257.86 ns 1.6468 µs
Components Comparison Fail from Start 174.05 ns 3.1028 µs
Components Comparison Fail from Mid 579.27 ns 4.3280 µs
Components Comparison Fail from End 1.1780 µs 2.7591 µs

Rel Short Path with 63 byte comps

Rel Short Path with 63 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 1.9252 µs 2.7271 µs
Components Next Back 1.5578 µs 3.9234 µs
As Path Iter 1.6343 µs 3.4623 µs
Components Equality Succeed 233.15 ns 530.92 ns
Components Equality Fail from Start 10.275 µs 8.0611 µs
Components Equality Fail from Mid 6.2605 µs 6.7329 µs
Components Equality Fail from End 178.45 ns 6.3707 µs
Components Comparison Succeed 263.34 ns 2.3225 µs
Components Comparison Fail from Start 179.58 ns 4.4502 µs
Components Comparison Fail from Mid 931.15 ns 6.8306 µs
Components Comparison Fail from End 1.8385 µs 3.4748 µs

Abs Short Path with 63 byte comps

Abs Short Path with 63 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 2.1539 µs 2.3425 µs
Components Next Back 2.3157 µs 3.8683 µs
As Path Iter 1.8390 µs 7.4535 µs
Components Equality Succeed 263.50 ns 508.68 ns
Components Equality Fail from Start 3.6342 µs 8.9211 µs
Components Equality Fail from Mid 6.5014 µs 6.5915 µs
Components Equality Fail from End 178.10 ns 6.2179 µs
Components Comparison Succeed 287.19 ns 2.3633 µs
Components Comparison Fail from Start 179.62 ns 4.5510 µs
Components Comparison Fail from Mid 919.18 ns 6.2328 µs
Components Comparison Fail from End 1.8608 µs 3.4720 µs

Rel Short Path with 127 byte comps

Rel Short Path with 127 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 3.2518 µs 4.0898 µs
Components Next Back 3.3354 µs 5.6201 µs
As Path Iter 3.3276 µs 4.9772 µs
Components Equality Succeed 263.35 ns 531.54 ns
Components Equality Fail from Start 19.435 µs 10.566 µs
Components Equality Fail from Mid 13.562 µs 9.1555 µs
Components Equality Fail from End 184.46 ns 8.4619 µs
Components Comparison Succeed 290.89 ns 4.1859 µs
Components Comparison Fail from Start 187.82 ns 5.8494 µs
Components Comparison Fail from Mid 2.1918 µs 11.176 µs
Components Comparison Fail from End 3.6074 µs 5.2176 µs

Abs Short Path with 127 byte comps

Abs Short Path with 127 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 3.4247 µs 4.2226 µs
Components Next Back 3.5046 µs 5.5146 µs
As Path Iter 3.5932 µs 12.244 µs
Components Equality Succeed 267.36 ns 673.21 ns
Components Equality Fail from Start 6.7022 µs 11.687 µs
Components Equality Fail from Mid 13.816 µs 8.8958 µs
Components Equality Fail from End 180.54 ns 7.8622 µs
Components Comparison Succeed 353.30 ns 4.2716 µs
Components Comparison Fail from Start 180.08 ns 6.0576 µs
Components Comparison Fail from Mid 2.1571 µs 11.583 µs
Components Comparison Fail from End 3.7429 µs 5.1813 µs

Rel Short Path with 255 byte comps

Rel Short Path with 255 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 6.0967 µs 6.8203 µs
Components Next Back 6.0934 µs 8.3736 µs
As Path Iter 6.0975 µs 7.6396 µs
Components Equality Succeed 263.27 ns 616.45 ns
Components Equality Fail from Start 36.050 µs 16.049 µs
Components Equality Fail from Mid 24.838 µs 13.375 µs
Components Equality Fail from End 177.95 ns 11.299 µs
Components Comparison Succeed 351.78 ns 6.8834 µs
Components Comparison Fail from Start 180.66 ns 8.5270 µs
Components Comparison Fail from Mid 3.4492 µs 18.673 µs
Components Comparison Fail from End 6.3924 µs 8.0659 µs

Abs Short Path with 255 byte comps

Abs Short Path with 255 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 6.2915 µs 6.9088 µs
Components Next Back 6.2694 µs 8.2776 µs
As Path Iter 6.2488 µs 21.266 µs
Components Equality Succeed 308.97 ns 643.59 ns
Components Equality Fail from Start 12.238 µs 17.135 µs
Components Equality Fail from Mid 23.903 µs 12.996 µs
Components Equality Fail from End 181.97 ns 10.858 µs
Components Comparison Succeed 393.99 ns 6.8820 µs
Components Comparison Fail from Start 178.33 ns 8.5702 µs
Components Comparison Fail from Mid 3.4632 µs 18.592 µs
Components Comparison Fail from End 6.2400 µs 7.8012 µs

Rel Long Path with 1 byte comps

Rel Long Path with 1 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 344.26 µs 655.98 µs
Components Next Back 346.09 µs 1.8866 ms
As Path Iter 601.46 µs 2.4040 ms
Components Equality Succeed 2.8038 µs 3.3767 µs
Components Equality Fail from Start 173.89 µs 4.2586 ms
Components Equality Fail from Mid 86.659 µs 2.1327 ms
Components Equality Fail from End 176.78 ns 4.9098 µs
Components Comparison Succeed 3.0033 µs 87.514 µs
Components Comparison Fail from Start 1.0939 µs 2.0857 µs
Components Comparison Fail from Mid 43.820 µs 46.101 µs
Components Comparison Fail from End 87.886 µs 88.585 µs

Abs Long Path with 1 byte comps

Abs Long Path with 1 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 344.45 µs 610.49 µs
Components Next Back 344.81 µs 1.8471 ms
As Path Iter 601.26 µs 2.7113 ms
Components Equality Succeed 2.9238 µs 3.4567 µs
Components Equality Fail from Start 172.65 µs 4.1402 ms
Components Equality Fail from Mid 87.651 µs 2.0776 ms
Components Equality Fail from End 177.37 ns 4.7197 µs
Components Comparison Succeed 3.0395 µs 87.978 µs
Components Comparison Fail from Start 178.06 ns 2.3181 µs
Components Comparison Fail from Mid 45.156 µs 46.276 µs
Components Comparison Fail from End 87.321 µs 88.899 µs

Rel Long Path with 3 byte comps

Rel Long Path with 3 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 220.86 µs 357.83 µs
Components Next Back 247.40 µs 1.0485 ms
As Path Iter 372.47 µs 1.3242 ms
Components Equality Succeed 2.8876 µs 3.4828 µs
Components Equality Fail from Start 173.88 µs 2.3652 ms
Components Equality Fail from Mid 87.751 µs 1.1918 ms
Components Equality Fail from End 176.81 ns 4.8875 µs
Components Comparison Succeed 3.0720 µs 87.537 µs
Components Comparison Fail from Start 177.36 ns 2.4226 µs
Components Comparison Fail from Mid 43.699 µs 46.658 µs
Components Comparison Fail from End 87.383 µs 88.890 µs

Abs Long Path with 3 byte comps

Abs Long Path with 3 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 215.03 µs 367.19 µs
Components Next Back 246.04 µs 943.31 µs
As Path Iter 378.89 µs 1.7884 ms
Components Equality Succeed 2.8745 µs 3.4879 µs
Components Equality Fail from Start 173.38 µs 2.2810 ms
Components Equality Fail from Mid 88.727 µs 1.1679 ms
Components Equality Fail from End 180.61 ns 4.6642 µs
Components Comparison Succeed 3.0542 µs 89.299 µs
Components Comparison Fail from Start 176.21 ns 2.2970 µs
Components Comparison Fail from Mid 46.693 µs 46.438 µs
Components Comparison Fail from End 89.039 µs 89.350 µs

Rel Long Path with 7 byte comps

Rel Long Path with 7 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 181.47 µs 240.18 µs
Components Next Back 172.56 µs 592.26 µs
As Path Iter 242.42 µs 893.52 µs
Components Equality Succeed 2.9634 µs 3.4926 µs
Components Equality Fail from Start 175.41 µs 1.2859 ms
Components Equality Fail from Mid 86.586 µs 651.06 µs
Components Equality Fail from End 175.22 ns 4.9300 µs
Components Comparison Succeed 3.0663 µs 86.878 µs
Components Comparison Fail from Start 178.42 ns 2.3806 µs
Components Comparison Fail from Mid 44.071 µs 45.917 µs
Components Comparison Fail from End 86.480 µs 88.283 µs

Abs Long Path with 7 byte comps

Abs Long Path with 7 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 153.15 µs 242.30 µs
Components Next Back 169.93 µs 507.07 µs
As Path Iter 248.11 µs 1.0180 ms
Components Equality Succeed 2.8853 µs 3.4343 µs
Components Equality Fail from Start 173.16 µs 1.2260 ms
Components Equality Fail from Mid 88.496 µs 617.91 µs
Components Equality Fail from End 176.14 ns 4.7296 µs
Components Comparison Succeed 3.0062 µs 87.801 µs
Components Comparison Fail from Start 178.96 ns 2.3340 µs
Components Comparison Fail from Mid 45.726 µs 46.335 µs
Components Comparison Fail from End 86.423 µs 88.526 µs

Rel Long Path with 15 byte comps

Rel Long Path with 15 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 139.42 µs 180.73 µs
Components Next Back 157.14 µs 357.82 µs
As Path Iter 182.69 µs 646.39 µs
Components Equality Succeed 2.8770 µs 3.4547 µs
Components Equality Fail from Start 174.31 µs 689.92 µs
Components Equality Fail from Mid 86.435 µs 349.60 µs
Components Equality Fail from End 177.14 ns 5.0505 µs
Components Comparison Succeed 3.0341 µs 88.701 µs
Components Comparison Fail from Start 177.11 ns 2.5807 µs
Components Comparison Fail from Mid 44.441 µs 46.382 µs
Components Comparison Fail from End 87.598 µs 88.179 µs

Abs Long Path with 15 byte comps

Abs Long Path with 15 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 140.62 µs 174.73 µs
Components Next Back 156.90 µs 281.05 µs
As Path Iter 179.61 µs 715.27 µs
Components Equality Succeed 2.9319 µs 3.4227 µs
Components Equality Fail from Start 174.21 µs 668.36 µs
Components Equality Fail from Mid 91.941 µs 354.23 µs
Components Equality Fail from End 177.22 ns 4.8537 µs
Components Comparison Succeed 3.0137 µs 88.022 µs
Components Comparison Fail from Start 176.59 ns 2.7197 µs
Components Comparison Fail from Mid 46.952 µs 47.216 µs
Components Comparison Fail from End 86.685 µs 88.320 µs

Rel Long Path with 31 byte comps

Rel Long Path with 31 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 120.11 µs 134.38 µs
Components Next Back 122.16 µs 223.91 µs
As Path Iter 134.16 µs 465.20 µs
Components Equality Succeed 2.9699 µs 3.4803 µs
Components Equality Fail from Start 178.94 µs 405.80 µs
Components Equality Fail from Mid 87.811 µs 220.56 µs
Components Equality Fail from End 176.31 ns 5.2418 µs
Components Comparison Succeed 3.0768 µs 86.679 µs
Components Comparison Fail from Start 176.99 ns 2.9584 µs
Components Comparison Fail from Mid 43.787 µs 47.826 µs
Components Comparison Fail from End 86.023 µs 87.720 µs

Abs Long Path with 31 byte comps

Abs Long Path with 31 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 122.60 µs 137.67 µs
Components Next Back 122.10 µs 166.79 µs
As Path Iter 132.20 µs 507.62 µs
Components Equality Succeed 2.8980 µs 3.4072 µs
Components Equality Fail from Start 172.85 µs 416.93 µs
Components Equality Fail from Mid 90.875 µs 208.84 µs
Components Equality Fail from End 177.41 ns 5.0552 µs
Components Comparison Succeed 2.9918 µs 87.994 µs
Components Comparison Fail from Start 175.48 ns 3.1461 µs
Components Comparison Fail from Mid 47.471 µs 47.771 µs
Components Comparison Fail from End 86.574 µs 88.218 µs

Rel Long Path with 63 byte comps

Rel Long Path with 63 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 125.55 µs 139.15 µs
Components Next Back 124.76 µs 183.45 µs
As Path Iter 110.08 µs 431.35 µs
Components Equality Succeed 2.9128 µs 3.4323 µs
Components Equality Fail from Start 181.86 µs 354.26 µs
Components Equality Fail from Mid 87.408 µs 181.41 µs
Components Equality Fail from End 175.58 ns 6.3567 µs
Components Comparison Succeed 3.0778 µs 87.566 µs
Components Comparison Fail from Start 179.18 ns 4.4189 µs
Components Comparison Fail from Mid 44.340 µs 48.597 µs
Components Comparison Fail from End 88.281 µs 88.417 µs

Abs Long Path with 63 byte comps

Abs Long Path with 63 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 126.30 µs 114.33 µs
Components Next Back 125.90 µs 158.54 µs
As Path Iter 108.34 µs 452.03 µs
Components Equality Succeed 2.8916 µs 3.4374 µs
Components Equality Fail from Start 174.15 µs 346.08 µs
Components Equality Fail from Mid 93.071 µs 180.16 µs
Components Equality Fail from End 175.94 ns 6.0989 µs
Components Comparison Succeed 3.0230 µs 88.009 µs
Components Comparison Fail from Start 179.19 ns 4.4784 µs
Components Comparison Fail from Mid 50.953 µs 50.667 µs
Components Comparison Fail from End 88.110 µs 87.882 µs

Rel Long Path with 127 byte comps

Rel Long Path with 127 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 104.30 µs 112.26 µs
Components Next Back 103.82 µs 135.80 µs
As Path Iter 111.33 µs 339.20 µs
Components Equality Succeed 2.9474 µs 3.4134 µs
Components Equality Fail from Start 188.21 µs 263.70 µs
Components Equality Fail from Mid 88.009 µs 139.88 µs
Components Equality Fail from End 176.33 ns 8.0539 µs
Components Comparison Succeed 3.0578 µs 86.784 µs
Components Comparison Fail from Start 179.27 ns 5.7551 µs
Components Comparison Fail from Mid 43.586 µs 50.014 µs
Components Comparison Fail from End 86.525 µs 89.180 µs

Abs Long Path with 127 byte comps

Abs Long Path with 127 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 104.16 µs 115.93 µs
Components Next Back 106.16 µs 124.07 µs
As Path Iter 113.46 µs 352.13 µs
Components Equality Succeed 2.9607 µs 3.4145 µs
Components Equality Fail from Start 174.18 µs 261.70 µs
Components Equality Fail from Mid 98.786 µs 142.78 µs
Components Equality Fail from End 180.49 ns 7.7682 µs
Components Comparison Succeed 3.0601 µs 88.463 µs
Components Comparison Fail from Start 180.03 ns 5.9098 µs
Components Comparison Fail from Mid 55.320 µs 55.349 µs
Components Comparison Fail from End 87.020 µs 88.972 µs

Rel Long Path with 255 byte comps

Rel Long Path with 255 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 96.676 µs 100.55 µs
Components Next Back 97.075 µs 110.36 µs
As Path Iter 99.612 µs 294.18 µs
Components Equality Succeed 2.9553 µs 3.5002 µs
Components Equality Fail from Start 197.28 µs 222.19 µs
Components Equality Fail from Mid 87.685 µs 120.75 µs
Components Equality Fail from End 179.66 ns 10.869 µs
Components Comparison Succeed 3.0944 µs 87.327 µs
Components Comparison Fail from Start 175.43 ns 8.4439 µs
Components Comparison Fail from Mid 43.911 µs 51.678 µs
Components Comparison Fail from End 88.120 µs 87.874 µs

Abs Long Path with 255 byte comps

Abs Long Path with 255 byte comps Component (Release Mode) Std Components (Release Mode)
Components Next 95.817 µs 101.72 µs
Components Next Back 96.392 µs 105.24 µs
As Path Iter 97.890 µs 306.51 µs
Components Equality Succeed 2.9196 µs 3.4062 µs
Components Equality Fail from Start 173.44 µs 225.27 µs
Components Equality Fail from Mid 107.46 µs 124.73 µs
Components Equality Fail from End 177.22 ns 10.694 µs
Components Comparison Succeed 3.0009 µs 87.357 µs
Components Comparison Fail from Start 177.16 ns 8.7318 µs
Components Comparison Fail from Mid 63.895 µs 64.154 µs
Components Comparison Fail from End 87.435 µs 87.834 µs

Rel Long Path Inconsistent Comp

Rel Long Path Inconsistent Comp Component (Release Mode) Std Components (Release Mode)
Components Next 109.89 µs 114.42 µs
Components Next Back 107.40 µs 226.79 µs
As Path Iter 109.13 µs 241.86 µs
Components Equality Succeed 2.8162 µs 3.3552 µs
Components Equality Fail from Start 190.15 µs 290.77 µs
Components Equality Fail from Mid 91.681 µs 155.42 µs
Components Equality Fail from End 1.3628 µs 4.1059 µs
Components Comparison Succeed 2.9610 µs 87.403 µs
Components Comparison Fail from Start 177.03 ns 6.4923 µs
Components Comparison Fail from Mid 43.861 µs 48.986 µs
Components Comparison Fail from End 87.824 µs 89.611 µs

Abs Long Path Inconsistent Comp

Abs Long Path Inconsistent Comp Component (Release Mode) Std Components (Release Mode)
Components Next 107.93 µs 115.69 µs
Components Next Back 108.59 µs 199.99 µs
As Path Iter 112.49 µs 252.22 µs
Components Equality Succeed 2.9486 µs 3.4288 µs
Components Equality Fail from Start 174.14 µs 286.10 µs
Components Equality Fail from Mid 95.492 µs 151.34 µs
Components Equality Fail from End 1.3818 µs 4.0351 µs
Components Comparison Succeed 3.0581 µs 86.798 µs
Components Comparison Fail from Start 178.02 ns 6.5550 µs
Components Comparison Fail from Mid 44.448 µs 48.976 µs
Components Comparison Fail from End 87.346 µs 89.529 µs

There are 12 rows where this Components iterator was slower than the std version.

  • Rel Short Path with 63 byte comps:
    • Components Equality Fail from Start: 10,275.0 ns vs 8,061.1 ns (1.27x slower)
  • Rel Short Path with 127 byte comps:
    • Components Equality Fail from Start: 19,435.0 ns vs 10,566.0 ns (1.84x slower)
    • Components Equality Fail from Mid: 13,562.0 ns vs 9,155.5 ns (1.48x slower)
  • Abs Short Path with 127 byte comps:
    • Components Equality Fail from Mid: 13,816.0 ns vs 8,895.8 ns (1.55x slower)
  • Rel Short Path with 255 byte comps:
    • Components Equality Fail from Start: 36,050.0 ns vs 16,049.0 ns (2.25x slower)
  • Rel Short Path with 255 byte comps:
    • Components Equality Fail from Mid: 24,838.0 ns vs 13,375.0 ns (1.86x slower)
  • Abs Short Path with 255 byte comps:
    • Components Equality Fail from Mid: 23,903.0 ns vs 12,996.0 ns (1.84x slower)
  • Abs Long Path with 3 byte comps:
    • Components Comparison Fail from Mid: 46,693.0 ns vs 46,438.0 ns (1.01x slower, but that's kinda just noise)
  • Abs Long Path with 63 byte comps:
    • Components Next: 126,300.0 ns vs 114,330.0 ns (1.10x slower, but maybe also just noise?)
    • Components Comparison Fail from Mid: 50,953.0 ns vs 50,667.0 ns (1.01x slower, kinda noise)
    • Components Comparison Fail from End: 88,110.0 ns vs 87,882.0 ns (1.0026x slower, which kinda just noise)
  • Rel Long Path with 255 byte comps:
    • Components Comparison Fail from End: 88,120.0 ns vs 87,874.0 ns (1.0027x slower, kinda noise tho)

Everything else is an improvement or the same on this Components iterator end with release mode optimizations. It's interesting to see that degradation occurs mostly when the components are at sizes of 63 bytes or further, but it still performs better/significantly better than Std Components with 31 bytes or less. On the other hand, it may be possible that std Components struggle with longer paths. Throwing in personal opinion, but I feel like that's a reasonable choice to choose this iterator as we don't often deal with paths with components with more than 20 bytes per component.

@clarfonthey

Copy link
Copy Markdown
Contributor

So, just to double-check right now: I've been mostly letting you continue to work on this with it still S-waiting-on-author, but if you feel confident this is ready for review, you can do @ rustbot ready.

@asder8215

asder8215 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Yup, I'm ready (I actually forgot that it was labeled as waiting on author, I usually click the refresh icon thing next to your name for reviews).
@rustbot ready

All I'll show next is debug performance results (likely tomorrow), but know that debug perf is significantly worse than the current std Components iterator (most likely due to no simd optimizations from compiler).

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2026
@asder8215

Copy link
Copy Markdown
Contributor Author

Took longer than it should've to share this, but I got around to getting the debug perf output:

Criterion Benchmark Results — Debug Mode

Times shown are the Criterion point estimate (middle of the confidence interval).

Rel Short Path with 1 byte comps

Rel Short Path with 1 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 6.4378 µs 1.1392 µs
Components Next Back 8.2586 µs 2.4140 µs
As Path Iter 8.0158 µs 3.1507 µs
Components Equality Succeed 1.0967 µs 1.0984 µs
Components Equality Fail from Start 34.141 µs 14.234 µs
Components Equality Fail from Mid 33.998 µs 14.149 µs
Components Equality Fail from End 10.037 µs 13.741 µs
Components Comparison Succeed 2.7354 µs 2.3790 µs
Components Comparison Fail from Start 29.761 µs 3.5096 µs
Components Comparison Fail from Mid 29.724 µs 3.4660 µs
Components Comparison Fail from End 19.854 µs 3.4886 µs

Abs Short Path with 1 byte comps

Abs Short Path with 1 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 9.5473 µs 1.2737 µs
Components Next Back 10.735 µs 2.5538 µs
As Path Iter 13.852 µs 5.2911 µs
Components Equality Succeed 1.1048 µs 1.1498 µs
Components Equality Fail from Start 27.903 µs 19.044 µs
Components Equality Fail from Mid 28.248 µs 19.242 µs
Components Equality Fail from End 10.013 µs 13.667 µs
Components Comparison Succeed 2.6793 µs 2.4051 µs
Components Comparison Fail from Start 9.3009 µs 3.7831 µs
Components Comparison Fail from Mid 9.2209 µs 3.7925 µs
Components Comparison Fail from End 21.191 µs 3.4967 µs

Rel Short Path with 3 byte comps

Rel Short Path with 3 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 6.8266 µs 1.1906 µs
Components Next Back 9.3404 µs 2.3978 µs
As Path Iter 8.3041 µs 3.1864 µs
Components Equality Succeed 1.0958 µs 1.1079 µs
Components Equality Fail from Start 40.109 µs 13.533 µs
Components Equality Fail from Mid 37.332 µs 13.368 µs
Components Equality Fail from End 10.145 µs 13.623 µs
Components Comparison Succeed 2.7252 µs 2.3966 µs
Components Comparison Fail from Start 9.1959 µs 3.7863 µs
Components Comparison Fail from Mid 10.688 µs 3.6896 µs
Components Comparison Fail from End 23.320 µs 3.5545 µs

Abs Short Path with 3 byte comps

Abs Short Path with 3 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 9.9818 µs 1.2858 µs
Components Next Back 11.842 µs 2.5794 µs
As Path Iter 14.404 µs 5.3953 µs
Components Equality Succeed 1.1024 µs 1.1716 µs
Components Equality Fail from Start 32.630 µs 19.099 µs
Components Equality Fail from Mid 40.291 µs 13.309 µs
Components Equality Fail from End 10.039 µs 13.367 µs
Components Comparison Succeed 2.7143 µs 2.4090 µs
Components Comparison Fail from Start 9.3335 µs 3.7407 µs
Components Comparison Fail from Mid 10.722 µs 3.8411 µs
Components Comparison Fail from End 24.362 µs 3.5019 µs

Rel Short Path with 7 byte comps

Rel Short Path with 7 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 7.9803 µs 1.2650 µs
Components Next Back 11.440 µs 2.5823 µs
As Path Iter 9.5229 µs 3.2550 µs
Components Equality Succeed 1.1086 µs 1.1611 µs
Components Equality Fail from Start 53.900 µs 13.688 µs
Components Equality Fail from Mid 45.661 µs 13.594 µs
Components Equality Fail from End 10.062 µs 13.718 µs
Components Comparison Succeed 2.7534 µs 2.5120 µs
Components Comparison Fail from Start 9.1875 µs 3.9342 µs
Components Comparison Fail from Mid 13.606 µs 3.8603 µs
Components Comparison Fail from End 27.965 µs 3.5708 µs

Abs Short Path with 7 byte comps

Abs Short Path with 7 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 11.137 µs 1.4080 µs
Components Next Back 13.969 µs 2.6581 µs
As Path Iter 15.541 µs 5.7407 µs
Components Equality Succeed 1.1125 µs 1.1555 µs
Components Equality Fail from Start 41.168 µs 18.989 µs
Components Equality Fail from Mid 48.195 µs 13.483 µs
Components Equality Fail from End 9.9710 µs 13.532 µs
Components Comparison Succeed 2.7109 µs 2.4539 µs
Components Comparison Fail from Start 9.1851 µs 3.8607 µs
Components Comparison Fail from Mid 13.589 µs 4.1656 µs
Components Comparison Fail from End 29.851 µs 3.6298 µs

Rel Short Path with 15 byte comps

Rel Short Path with 15 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 10.247 µs 1.5257 µs
Components Next Back 16.219 µs 2.6784 µs
As Path Iter 11.640 µs 3.4354 µs
Components Equality Succeed 1.1002 µs 1.1622 µs
Components Equality Fail from Start 82.522 µs 13.711 µs
Components Equality Fail from Mid 60.869 µs 13.718 µs
Components Equality Fail from End 9.9352 µs 13.612 µs
Components Comparison Succeed 2.7448 µs 2.5436 µs
Components Comparison Fail from Start 9.2689 µs 3.9122 µs
Components Comparison Fail from Mid 18.841 µs 4.4284 µs
Components Comparison Fail from End 40.414 µs 3.7538 µs

Abs Short Path with 15 byte comps

Abs Short Path with 15 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 13.502 µs 1.5967 µs
Components Next Back 18.704 µs 2.7476 µs
As Path Iter 17.736 µs 6.1226 µs
Components Equality Succeed 1.1099 µs 1.1495 µs
Components Equality Fail from Start 59.012 µs 19.197 µs
Components Equality Fail from Mid 64.355 µs 13.504 µs
Components Equality Fail from End 10.086 µs 13.520 µs
Components Comparison Succeed 2.7280 µs 2.5297 µs
Components Comparison Fail from Start 9.3345 µs 4.3740 µs
Components Comparison Fail from Mid 18.809 µs 5.0225 µs
Components Comparison Fail from End 41.581 µs 3.7679 µs

Rel Short Path with 31 byte comps

Rel Short Path with 31 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 15.112 µs 1.8922 µs
Components Next Back 26.256 µs 2.8587 µs
As Path Iter 16.450 µs 3.7352 µs
Components Equality Succeed 1.1195 µs 1.2064 µs
Components Equality Fail from Start 142.67 µs 14.425 µs
Components Equality Fail from Mid 95.737 µs 14.254 µs
Components Equality Fail from End 9.9635 µs 13.926 µs
Components Comparison Succeed 2.8444 µs 3.4870 µs
Components Comparison Fail from Start 9.1892 µs 4.3163 µs
Components Comparison Fail from Mid 30.056 µs 5.7236 µs
Components Comparison Fail from End 63.688 µs 4.5268 µs

Abs Short Path with 31 byte comps

Abs Short Path with 31 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 18.397 µs 1.9498 µs
Components Next Back 28.787 µs 2.9667 µs
As Path Iter 22.874 µs 6.9504 µs
Components Equality Succeed 1.1702 µs 1.1798 µs
Components Equality Fail from Start 94.065 µs 19.749 µs
Components Equality Fail from Mid 100.19 µs 13.880 µs
Components Equality Fail from End 10.042 µs 13.776 µs
Components Comparison Succeed 2.7850 µs 3.4371 µs
Components Comparison Fail from Start 9.3519 µs 4.8997 µs
Components Comparison Fail from Mid 30.509 µs 5.8196 µs
Components Comparison Fail from End 64.984 µs 4.5471 µs

Rel Short Path with 63 byte comps

Rel Short Path with 63 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 24.945 µs 2.5017 µs
Components Next Back 44.709 µs 3.4319 µs
As Path Iter 26.146 µs 4.3770 µs
Components Equality Succeed 1.1258 µs 1.1512 µs
Components Equality Fail from Start 264.62 µs 16.698 µs
Components Equality Fail from Mid 167.13 µs 15.232 µs
Components Equality Fail from End 10.035 µs 14.827 µs
Components Comparison Succeed 2.7809 µs 4.7815 µs
Components Comparison Fail from Start 9.3597 µs 5.3984 µs
Components Comparison Fail from Mid 54.137 µs 8.0974 µs
Components Comparison Fail from End 109.35 µs 5.8949 µs

Abs Short Path with 63 byte comps

Abs Short Path with 63 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 27.877 µs 3.2164 µs
Components Next Back 47.873 µs 3.5143 µs
As Path Iter 32.093 µs 10.101 µs
Components Equality Succeed 1.1548 µs 1.2559 µs
Components Equality Fail from Start 166.83 µs 21.891 µs
Components Equality Fail from Mid 171.98 µs 15.255 µs
Components Equality Fail from End 10.028 µs 14.881 µs
Components Comparison Succeed 2.8828 µs 4.8640 µs
Components Comparison Fail from Start 9.3225 µs 6.1235 µs
Components Comparison Fail from Mid 53.969 µs 8.4905 µs
Components Comparison Fail from End 110.40 µs 5.8561 µs

Rel Short Path with 127 byte comps

Rel Short Path with 127 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 44.027 µs 4.4253 µs
Components Next Back 83.406 µs 5.1763 µs
As Path Iter 44.976 µs 6.1615 µs
Components Equality Succeed 1.1484 µs 1.1837 µs
Components Equality Fail from Start 514.52 µs 19.019 µs
Components Equality Fail from Mid 303.99 µs 17.718 µs
Components Equality Fail from End 10.021 µs 16.606 µs
Components Comparison Succeed 2.7864 µs 7.7456 µs
Components Comparison Fail from Start 9.2476 µs 7.0782 µs
Components Comparison Fail from Mid 100.26 µs 13.540 µs
Components Comparison Fail from End 201.14 µs 8.7758 µs

Abs Short Path with 127 byte comps

Abs Short Path with 127 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 47.140 µs 4.5925 µs
Components Next Back 85.907 µs 5.2626 µs
As Path Iter 51.467 µs 14.666 µs
Components Equality Succeed 1.2262 µs 1.3393 µs
Components Equality Fail from Start 318.92 µs 24.564 µs
Components Equality Fail from Mid 310.40 µs 17.626 µs
Components Equality Fail from End 10.027 µs 16.431 µs
Components Comparison Succeed 2.7846 µs 7.8352 µs
Components Comparison Fail from Start 9.2082 µs 7.6740 µs
Components Comparison Fail from Mid 99.971 µs 13.543 µs
Components Comparison Fail from End 202.37 µs 8.7947 µs

Rel Short Path with 255 byte comps

Rel Short Path with 255 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 82.033 µs 7.0729 µs
Components Next Back 159.66 µs 7.8331 µs
As Path Iter 82.358 µs 8.8749 µs
Components Equality Succeed 1.1527 µs 1.2439 µs
Components Equality Fail from Start 1.0304 ms 24.412 µs
Components Equality Fail from Mid 601.25 µs 21.832 µs
Components Equality Fail from End 10.086 µs 19.542 µs
Components Comparison Succeed 2.7899 µs 13.032 µs
Components Comparison Fail from Start 9.2783 µs 9.8213 µs
Components Comparison Fail from Mid 194.58 µs 21.851 µs
Components Comparison Fail from End 386.95 µs 14.159 µs

Abs Short Path with 255 byte comps

Abs Short Path with 255 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 85.146 µs 7.2896 µs
Components Next Back 163.73 µs 7.9466 µs
As Path Iter 89.225 µs 22.796 µs
Components Equality Succeed 1.2075 µs 1.3189 µs
Components Equality Fail from Start 629.59 µs 29.942 µs
Components Equality Fail from Mid 595.72 µs 21.679 µs
Components Equality Fail from End 10.137 µs 19.398 µs
Components Comparison Succeed 2.9216 µs 13.107 µs
Components Comparison Fail from Start 9.3276 µs 10.377 µs
Components Comparison Fail from Mid 191.86 µs 21.921 µs
Components Comparison Fail from End 386.10 µs 14.098 µs

Rel Long Path with 1 byte comps

Rel Long Path with 1 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 12.614 ms 728.31 µs
Components Next Back 14.522 ms 2.0008 ms
As Path Iter 18.305 ms 4.0343 ms
Components Equality Succeed 3.7130 µs 3.8900 µs
Components Equality Fail from Start 10.127 ms 13.570 ms
Components Equality Fail from Mid 5.0470 ms 6.8396 ms
Components Equality Fail from End 10.066 µs 13.594 µs
Components Comparison Succeed 5.2955 µs 173.03 µs
Components Comparison Fail from Start 30.523 µs 3.4961 µs
Components Comparison Fail from Mid 2.9366 ms 89.190 µs
Components Comparison Fail from End 5.7575 ms 173.72 µs

Abs Long Path with 1 byte comps

Abs Long Path with 1 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 12.457 ms 612.15 µs
Components Next Back 14.468 ms 1.8831 ms
As Path Iter 18.220 ms 3.9931 ms
Components Equality Succeed 3.7998 µs 3.9723 µs
Components Equality Fail from Start 10.098 ms 13.717 ms
Components Equality Fail from Mid 5.0045 ms 6.8394 ms
Components Equality Fail from End 9.9275 µs 13.863 µs
Components Comparison Succeed 5.6616 µs 174.20 µs
Components Comparison Fail from Start 9.1963 µs 3.8282 µs
Components Comparison Fail from Mid 2.9220 ms 90.677 µs
Components Comparison Fail from End 5.7787 ms 174.83 µs

Rel Long Path with 3 byte comps

Rel Long Path with 3 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 6.6316 ms 394.25 µs
Components Next Back 8.3363 ms 1.0421 ms
As Path Iter 9.6089 ms 2.1082 ms
Components Equality Succeed 3.7514 µs 3.9261 µs
Components Equality Fail from Start 10.061 ms 6.9888 ms
Components Equality Fail from Mid 5.0145 ms 3.4380 ms
Components Equality Fail from End 10.085 µs 13.518 µs
Components Comparison Succeed 5.3316 µs 174.20 µs
Components Comparison Fail from Start 9.3532 µs 3.7654 µs
Components Comparison Fail from Mid 2.9584 ms 88.559 µs
Components Comparison Fail from End 5.8725 ms 174.26 µs

Abs Long Path with 3 byte comps

Abs Long Path with 3 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 6.6536 ms 357.15 µs
Components Next Back 8.2994 ms 973.76 µs
As Path Iter 9.5217 ms 2.0636 ms
Components Equality Succeed 3.8068 µs 4.0258 µs
Components Equality Fail from Start 10.087 ms 6.9600 ms
Components Equality Fail from Mid 5.0854 ms 3.4849 ms
Components Equality Fail from End 10.188 µs 13.566 µs
Components Comparison Succeed 5.6440 µs 173.84 µs
Components Comparison Fail from Start 9.2498 µs 3.7420 µs
Components Comparison Fail from Mid 2.9644 ms 90.067 µs
Components Comparison Fail from End 5.8418 ms 174.48 µs

Rel Long Path with 7 byte comps

Rel Long Path with 7 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 3.9200 ms 244.27 µs
Components Next Back 5.2993 ms 596.22 µs
As Path Iter 5.4040 ms 1.1990 ms
Components Equality Succeed 3.8777 µs 3.9712 µs
Components Equality Fail from Start 10.179 ms 3.6636 ms
Components Equality Fail from Mid 5.0322 ms 1.8314 ms
Components Equality Fail from End 10.101 µs 13.456 µs
Components Comparison Succeed 5.8416 µs 172.26 µs
Components Comparison Fail from Start 9.3444 µs 3.7278 µs
Components Comparison Fail from Mid 2.9534 ms 89.445 µs
Components Comparison Fail from End 5.8604 ms 174.19 µs

Abs Long Path with 7 byte comps

Abs Long Path with 7 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 3.9515 ms 233.84 µs
Components Next Back 5.2754 ms 524.81 µs
As Path Iter 5.3510 ms 1.1775 ms
Components Equality Succeed 3.7713 µs 3.8935 µs
Components Equality Fail from Start 10.132 ms 3.4598 ms
Components Equality Fail from Mid 5.0164 ms 1.7550 ms
Components Equality Fail from End 10.108 µs 13.464 µs
Components Comparison Succeed 5.5595 µs 172.43 µs
Components Comparison Fail from Start 9.3020 µs 3.8586 µs
Components Comparison Fail from Mid 2.9373 ms 89.422 µs
Components Comparison Fail from End 5.8515 ms 177.10 µs

Rel Long Path with 15 byte comps

Rel Long Path with 15 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 2.6000 ms 166.03 µs
Components Next Back 3.8049 ms 329.80 µs
As Path Iter 3.3084 ms 796.89 µs
Components Equality Succeed 3.8163 µs 4.0318 µs
Components Equality Fail from Start 10.307 ms 1.8676 ms
Components Equality Fail from Mid 5.0212 ms 954.56 µs
Components Equality Fail from End 10.092 µs 13.655 µs
Components Comparison Succeed 5.6628 µs 174.74 µs
Components Comparison Fail from Start 9.4357 µs 3.9212 µs
Components Comparison Fail from Mid 2.9735 ms 89.122 µs
Components Comparison Fail from End 5.8993 ms 174.27 µs

Abs Long Path with 15 byte comps

Abs Long Path with 15 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 2.5656 ms 190.51 µs
Components Next Back 3.8175 ms 292.65 µs
As Path Iter 3.3160 ms 819.87 µs
Components Equality Succeed 3.7538 µs 3.9812 µs
Components Equality Fail from Start 10.036 ms 1.8093 ms
Components Equality Fail from Mid 5.0445 ms 909.09 µs
Components Equality Fail from End 10.011 µs 13.689 µs
Components Comparison Succeed 5.6391 µs 174.27 µs
Components Comparison Fail from Start 9.3228 µs 4.3348 µs
Components Comparison Fail from Mid 2.9840 ms 90.177 µs
Components Comparison Fail from End 5.8432 ms 175.02 µs

Rel Long Path with 31 byte comps

Rel Long Path with 31 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.9003 ms 130.64 µs
Components Next Back 3.2103 ms 196.39 µs
As Path Iter 2.2400 ms 524.38 µs
Components Equality Succeed 3.7896 µs 3.9755 µs
Components Equality Fail from Start 10.233 ms 995.67 µs
Components Equality Fail from Mid 5.0698 ms 505.81 µs
Components Equality Fail from End 9.9660 µs 13.720 µs
Components Comparison Succeed 5.6270 µs 173.54 µs
Components Comparison Fail from Start 9.2229 µs 4.4559 µs
Components Comparison Fail from Mid 2.9523 ms 89.938 µs
Components Comparison Fail from End 5.8845 ms 173.22 µs

Abs Long Path with 31 byte comps

Abs Long Path with 31 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.8982 ms 135.47 µs
Components Next Back 3.1542 ms 183.84 µs
As Path Iter 2.2371 ms 537.19 µs
Components Equality Succeed 3.7571 µs 3.9120 µs
Components Equality Fail from Start 10.054 ms 976.80 µs
Components Equality Fail from Mid 5.0619 ms 493.50 µs
Components Equality Fail from End 9.9660 µs 13.739 µs
Components Comparison Succeed 5.6214 µs 174.63 µs
Components Comparison Fail from Start 9.3391 µs 4.9313 µs
Components Comparison Fail from Mid 3.0027 ms 91.599 µs
Components Comparison Fail from End 5.8099 ms 173.33 µs

Rel Long Path with 63 byte comps

Rel Long Path with 63 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.5855 ms 107.24 µs
Components Next Back 2.8497 ms 168.03 µs
As Path Iter 1.7304 ms 447.29 µs
Components Equality Succeed 3.7958 µs 4.0136 µs
Components Equality Fail from Start 10.149 ms 622.52 µs
Components Equality Fail from Mid 5.0756 ms 320.30 µs
Components Equality Fail from End 10.073 µs 14.955 µs
Components Comparison Succeed 5.6053 µs 173.09 µs
Components Comparison Fail from Start 9.4008 µs 5.1235 µs
Components Comparison Fail from Mid 2.9527 ms 91.584 µs
Components Comparison Fail from End 5.8619 ms 174.70 µs

Abs Long Path with 63 byte comps

Abs Long Path with 63 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.6110 ms 144.10 µs
Components Next Back 2.8542 ms 160.26 µs
As Path Iter 1.7826 ms 483.97 µs
Components Equality Succeed 3.8785 µs 4.0651 µs
Components Equality Fail from Start 10.160 ms 628.24 µs
Components Equality Fail from Mid 5.1353 ms 325.61 µs
Components Equality Fail from End 10.133 µs 14.860 µs
Components Comparison Succeed 5.6886 µs 178.83 µs
Components Comparison Fail from Start 9.2594 µs 6.0929 µs
Components Comparison Fail from Mid 3.0290 ms 95.971 µs
Components Comparison Fail from End 5.8433 ms 184.50 µs

Rel Long Path with 127 byte comps

Rel Long Path with 127 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.4151 ms 111.49 µs
Components Next Back 2.6400 ms 131.11 µs
As Path Iter 1.4897 ms 373.74 µs
Components Equality Succeed 3.8890 µs 4.0344 µs
Components Equality Fail from Start 10.372 ms 407.83 µs
Components Equality Fail from Mid 5.0993 ms 217.95 µs
Components Equality Fail from End 10.119 µs 16.569 µs
Components Comparison Succeed 5.7207 µs 173.39 µs
Components Comparison Fail from Start 9.3612 µs 7.2275 µs
Components Comparison Fail from Mid 2.9632 ms 95.936 µs
Components Comparison Fail from End 5.8599 ms 177.48 µs

Abs Long Path with 127 byte comps

Abs Long Path with 127 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.4246 ms 115.27 µs
Components Next Back 2.6219 ms 124.53 µs
As Path Iter 1.4929 ms 371.09 µs
Components Equality Succeed 3.8221 µs 3.9404 µs
Components Equality Fail from Start 10.315 ms 406.05 µs
Components Equality Fail from Mid 5.2416 ms 218.22 µs
Components Equality Fail from End 10.085 µs 16.556 µs
Components Comparison Succeed 5.6335 µs 173.95 µs
Components Comparison Fail from Start 9.2377 µs 7.6276 µs
Components Comparison Fail from Mid 3.0788 ms 100.18 µs
Components Comparison Fail from End 5.8855 ms 176.47 µs

Rel Long Path with 255 byte comps

Rel Long Path with 255 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.3126 ms 98.837 µs
Components Next Back 2.5336 ms 108.65 µs
As Path Iter 1.3651 ms 305.51 µs
Components Equality Succeed 3.8606 µs 3.9929 µs
Components Equality Fail from Start 10.702 ms 292.46 µs
Components Equality Fail from Mid 5.0457 ms 163.04 µs
Components Equality Fail from End 10.045 µs 19.764 µs
Components Comparison Succeed 5.6570 µs 173.55 µs
Components Comparison Fail from Start 9.2844 µs 9.8687 µs
Components Comparison Fail from Mid 2.9305 ms 95.750 µs
Components Comparison Fail from End 5.8113 ms 173.10 µs

Abs Long Path with 255 byte comps

Abs Long Path with 255 byte comps Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.3233 ms 102.60 µs
Components Next Back 2.5396 ms 108.03 µs
As Path Iter 1.3571 ms 325.56 µs
Components Equality Succeed 3.8321 µs 4.0262 µs
Components Equality Fail from Start 10.245 ms 302.77 µs
Components Equality Fail from Mid 5.4605 ms 172.89 µs
Components Equality Fail from End 10.236 µs 19.795 µs
Components Comparison Succeed 5.9321 µs 181.15 µs
Components Comparison Fail from Start 9.4601 µs 10.487 µs
Components Comparison Fail from Mid 3.2950 ms 110.35 µs
Components Comparison Fail from End 5.9534 ms 177.74 µs

Rel Long Path Inconsistent Comp

Rel Long Path Inconsistent Comp Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.4421 ms 113.19 µs
Components Next Back 2.6685 ms 135.91 µs
As Path Iter 1.5167 ms 267.08 µs
Components Equality Succeed 3.7618 µs 3.9473 µs
Components Equality Fail from Start 10.330 ms 445.83 µs
Components Equality Fail from Mid 5.1752 ms 252.55 µs
Components Equality Fail from End 33.768 µs 12.992 µs
Components Comparison Succeed 5.3711 µs 178.21 µs
Components Comparison Fail from Start 9.2756 µs 7.9148 µs
Components Comparison Fail from Mid 2.9903 ms 93.388 µs
Components Comparison Fail from End 5.9233 ms 183.25 µs

Abs Long Path Inconsistent Comp

Abs Long Path Inconsistent Comp Component (Debug Mode) Std Components (Debug Mode)
Components Next 1.4476 ms 117.55 µs
Components Next Back 2.7392 ms 129.72 µs
As Path Iter 1.5231 ms 271.93 µs
Components Equality Succeed 3.8834 µs 3.9229 µs
Components Equality Fail from Start 10.205 ms 448.12 µs
Components Equality Fail from Mid 5.1635 ms 250.95 µs
Components Equality Fail from End 33.640 µs 12.439 µs
Components Comparison Succeed 5.6291 µs 173.85 µs
Components Comparison Fail from Start 9.3225 µs 8.2978 µs
Components Comparison Fail from Mid 2.9711 ms 91.619 µs
Components Comparison Fail from End 5.9557 ms 174.48 µs

Yeah, the debug performance is horrendous for this Components iterator. It relies heavily on LLVM optimizations in release mode.

@clarfonthey

Copy link
Copy Markdown
Contributor

FWIW, have noticed that this is ready for review and do plan to get to this relatively soonish. Since I'm going to be at rustconf in about a week I want to try and merge this before then unless there are major changes needed.

@asder8215

Copy link
Copy Markdown
Contributor Author

Since I'm going to be at rustconf in about a week I want to try and merge this before then unless there are major changes needed.

I guess my concern here is: does this require a libs team discussion on the debug mode performance of this Components iterator? Is it acceptable for this iterator to have worse perf in debug mode compared to current version? I bring this up because I'm worried about how this affects performance of building binaries/libraries in debug mode using cargo.

@clarfonthey

clarfonthey commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Oh, wow, I hadn't actually looked at those numbers, but uh, 10x in some cases is pretty bad. I guess we could try a perf run:

@bors try
@rust-timer queue profiles=debug

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 30, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 30, 2026
Split `Components` iterator to prefixed and non-prefixed versions and optimize `Components` for non-prefix path based platforms
@rust-bors

rust-bors Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6e44b7b (6e44b7b25aec040ef7b39b2e27988aae1a380b89)
Base parent: 4545c83 (4545c8369286cd331ab9d6250c25630a69d6f790)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6e44b7b): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.2%, secondary 2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.0% [1.6%, 2.3%] 3
Regressions ❌
(secondary)
2.7% [1.8%, 3.3%] 5
Improvements ✅
(primary)
-6.8% [-6.8%, -6.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-6.8%, 2.3%] 4

Cycles

This perf run didn't have relevant results for this metric.

Binary size

Results (primary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 3

Bootstrap: 474.853s -> 473.232s (-0.34%)
Artifact size: 402.86 MiB -> 402.83 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 30, 2026
@clarfonthey

clarfonthey commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Yeah, that's expectedly unhelpful, probably because the standard library is compiled in release mode. I'm not actually sure you can easily run the debug versions without build-std or testing the repo?

Will have to double-check, but pretty sure this should be fine. If you want to try running your benchmarks with debug mode combined with the release-compiled std, pretty sure the rustc dev guide has some notes on making rustup use a custom libstd build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants