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

Vectorize basic_string::rfind (the string needle overload) #5057

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AlexGuteniev
Copy link
Contributor

Towards #5036.

Similar to #5048, the differences:

Benchmark main this
member_rfind<not_highly_aligned_string>/0 108 ns 23.2 ns
member_rfind<not_highly_aligned_string>/1 101 ns 22.6 ns
member_rfind<not_highly_aligned_string>/2 1298 ns 305 ns
member_rfind<not_highly_aligned_string>/3 1554 ns 347 ns
member_rfind<not_highly_aligned_string>/4 7914 ns 4870 ns
member_rfind<not_highly_aligned_string>/5 15104 ns 15482 ns
member_rfind<not_highly_aligned_wstring>/0 98.1 ns 39.7 ns
member_rfind<not_highly_aligned_wstring>/1 101 ns 38.9 ns
member_rfind<not_highly_aligned_wstring>/2 1288 ns 624 ns
member_rfind<not_highly_aligned_wstring>/3 1559 ns 722 ns
member_rfind<not_highly_aligned_wstring>/4 5645 ns 9777 ns
member_rfind<not_highly_aligned_wstring>/5 15808 ns 20634 ns

constexpr data_and_pattern patterns[] = {
/* 0. Small, closer to end */ {lorem_ipsum, "aliquet"sv},
/* 1. Large, closer to end */ {lorem_ipsum, "aliquet malesuada"sv},
/* 2. Small, closer to begin */ {lorem_ipsum, "pulvinar"sv},
/* 3. Large, closer to begin */ {lorem_ipsum, "dapibus elit interdum"sv},
/* 4. Small, evil */ {fill_pattern_view<3000, false>, fill_pattern_view<7, true>},
/* 5. Large, evil */ {fill_pattern_view<3000, false>, fill_pattern_view<20, true>},
};

@AlexGuteniev AlexGuteniev requested a review from a team as a code owner October 31, 2024 06:16
@StephanTLavavej StephanTLavavej added the performance Must go faster label Oct 31, 2024
@StephanTLavavej StephanTLavavej self-assigned this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
Status: Initial Review
Development

Successfully merging this pull request may close these issues.

2 participants