-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #67356 - Centril:rollup-paaw3ju, r=Centril
Rollup of 8 pull requests Successful merges: - #67249 (Improve code generated for `starts_with(<literal char>)`) - #67308 (Delete flaky test net::tcp::tests::fast_rebind) - #67318 (Improve typeck & lowering docs for slice patterns) - #67322 (use Self alias in place of macros) - #67323 (make transparent enums more ordinary) - #67336 (Fix JS error when loading page with search) - #67344 (.gitignore: Don't ignore a file that exists in the repository) - #67349 (Minor: update Unsize docs for dyn syntax) Failed merges: r? @ghost
- Loading branch information
Showing
13 changed files
with
134 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ mod hash; | |
mod iter; | ||
mod num; | ||
mod ops; | ||
mod pattern; | ||
mod slice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use test::black_box; | ||
use test::Bencher; | ||
|
||
#[bench] | ||
fn starts_with_char(b: &mut Bencher) { | ||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind"); | ||
b.iter(|| { | ||
for _ in 0..1024 { | ||
black_box(text.starts_with('k')); | ||
} | ||
}) | ||
} | ||
|
||
#[bench] | ||
fn starts_with_str(b: &mut Bencher) { | ||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind"); | ||
b.iter(|| { | ||
for _ in 0..1024 { | ||
black_box(text.starts_with("k")); | ||
} | ||
}) | ||
} | ||
|
||
|
||
#[bench] | ||
fn ends_with_char(b: &mut Bencher) { | ||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind"); | ||
b.iter(|| { | ||
for _ in 0..1024 { | ||
black_box(text.ends_with('k')); | ||
} | ||
}) | ||
} | ||
|
||
#[bench] | ||
fn ends_with_str(b: &mut Bencher) { | ||
let text = black_box("kdjsfhlakfhlsghlkvcnljknfqiunvcijqenwodind"); | ||
b.iter(|| { | ||
for _ in 0..1024 { | ||
black_box(text.ends_with("k")); | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.