Skip to content

Conversation

@the8472
Copy link
Member

@the8472 the8472 commented Jun 9, 2021

Filesystems generally have a tree-ish structure which means paths are more likely to share a prefix than a suffix. Absolute paths are especially prone to share long prefixes.

quick benchmark consisting of a search through through a vec containing the absolute paths of all (1850) files in compiler/:

# old
test path::tests::bench_path_cmp                                  ... bench:     227,407 ns/iter (+/- 2,162)

# new
test path::tests::bench_path_cmp                                  ... bench:      64,976 ns/iter (+/- 1,142)

Filesystems generally have a tree-ish structure which means
paths are more likely to share a prefix than a suffix. Absolute paths
are especially prone to share long prefixes.
@rust-highfive
Copy link
Contributor

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 9, 2021
@the8472
Copy link
Member Author

the8472 commented Jun 9, 2021

@rustbot label T-libs-impl

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 9, 2021
@kennytm
Copy link
Member

kennytm commented Jun 16, 2021

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Jun 16, 2021

📌 Commit 53d71c1 has been approved by kennytm

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 16, 2021
@bors
Copy link
Collaborator

bors commented Jun 16, 2021

⌛ Testing commit 53d71c1 with merge 0041ef71d6a83e496a616867e6fbe52097b67a2c...

@rust-log-analyzer
Copy link
Collaborator

The job dist-mipsel-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Collaborator

bors commented Jun 16, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 16, 2021
@the8472
Copy link
Member Author

the8472 commented Jun 16, 2021

failed to get 200 response from https://crates.io/api/v1/crates/byteorder/1.4.3/download, got 502

looks like a spurious error.

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 16, 2021
@bors
Copy link
Collaborator

bors commented Jun 16, 2021

⌛ Testing commit 53d71c1 with merge 9fef8d9...

@bors
Copy link
Collaborator

bors commented Jun 16, 2021

☀️ Test successful - checks-actions
Approved by: kennytm
Pushing 9fef8d9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 16, 2021
@bors bors merged commit 9fef8d9 into rust-lang:master Jun 16, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 16, 2021
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
optimize Eq implementation for paths

Filesystems generally have a tree-ish structure which means paths are more likely to share a prefix than a suffix. Absolute paths are especially prone to share long prefixes.

quick benchmark consisting of a search through through a vec containing the absolute paths of all (1850) files in `compiler/`:

```
# old
test path::tests::bench_path_cmp                                  ... bench:     227,407 ns/iter (+/- 2,162)

# new
test path::tests::bench_path_cmp                                  ... bench:      64,976 ns/iter (+/- 1,142)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants