Skip to content

Vectorize basic_string::find (the string needle overload) - #5048

Merged
Stephan T. Lavavej (StephanTLavavej) merged 11 commits into
microsoft:mainfrom
AlexGuteniev:strstr
Oct 30, 2024
Merged

Vectorize basic_string::find (the string needle overload) #5048
Stephan T. Lavavej (StephanTLavavej) merged 11 commits into
microsoft:mainfrom
AlexGuteniev:strstr

Conversation

@AlexGuteniev

Copy link
Copy Markdown
Contributor

Towards #5036

Benchmark main this
member_find<std::string>/0 1149 ns 292 ns
member_find<std::string>/1 1174 ns 300 ns
member_find<std::string>/2 52.1 ns 31.5 ns
member_find<std::string>/3 30.4 ns 18.1 ns
member_find<std::string>/4 14420 ns 1395 ns
member_find<std::string>/5 22193 ns 11719 ns
member_find<std::wstring>/0 943 ns 502 ns
member_find<std::wstring>/1 1087 ns 594 ns
member_find<std::wstring>/2 81.5 ns 58.6 ns
member_find<std::wstring>/3 42.5 ns 28.6 ns
member_find<std::wstring>/4 6463 ns 7656 ns
member_find<std::wstring>/5 18725 ns 21484 ns

Comment thread tests/std/tests/VSO_0000000_vector_algorithms/test.cpp
Comment thread tests/std/tests/VSO_0000000_vector_algorithms/test.cpp Outdated
Comment thread stl/inc/__msvc_string_view.hpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks! 🧶 I pushed a minor stylistic change and a syntax fix.

@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 5e8f003 into microsoft:main Oct 30, 2024
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for extending vectorization to this important member function! 🚀 ✨ 💚

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

Labels

performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants