Skip to content

Add more benchmark tests to path/posix #11137

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

Merged
merged 1 commit into from
Jan 1, 2014
Merged

Add more benchmark tests to path/posix #11137

merged 1 commit into from
Jan 1, 2014

Conversation

g3xzh
Copy link
Contributor

@g3xzh g3xzh commented Dec 25, 2013

Benchmark testing is_ancestor_of and pop

ref: #9694

fn is_ancestor_of_path_with_10_dirs(bh: &mut BenchHarness) {
let posix_path = Path::new("/home/1/2/3/4/5/6/7/8/9");
bh.iter(|| {
posix_path.is_ancestor_of(&Path::new("/home/1/2/3/4/5/6/7/8"));
Copy link
Member

Choose a reason for hiding this comment

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

This is going to construct a new path in the hot loop, which is going to skew the benchmark. Move it out of the closure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's correct. Let me fix it.

@g3xzh
Copy link
Contributor Author

g3xzh commented Dec 29, 2013

@cmr 👍

Benchmark testing `is_ancestor_of` and `path_relative_from`
bors added a commit that referenced this pull request Jan 1, 2014
Benchmark testing `is_ancestor_of` and `pop`

ref: #9694
@bors bors closed this Jan 1, 2014
@bors bors merged commit 9f1adf0 into rust-lang:master Jan 1, 2014
@g3xzh g3xzh deleted the benchm branch January 6, 2014 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants