Skip to content

Add std::fill and std::fill_n benchmarks - #5400

Merged
Stephan T. Lavavej (StephanTLavavej) merged 15 commits into
microsoft:mainfrom
barcharcraz:dev/chbarto/fill_benchmarks
Apr 22, 2025
Merged

Add std::fill and std::fill_n benchmarks#5400
Stephan T. Lavavej (StephanTLavavej) merged 15 commits into
microsoft:mainfrom
barcharcraz:dev/chbarto/fill_benchmarks

Conversation

@barcharcraz

Copy link
Copy Markdown
Contributor

I wrote these benchmarks while fixing some issues with memset loop recognition in the compiler, but I think they are more broadly useful.

Comment thread benchmarks/src/fill.cpp Outdated
Comment thread benchmarks/src/fill.cpp
Comment thread benchmarks/src/fill.cpp
Comment thread benchmarks/src/fill.cpp Outdated
Comment thread benchmarks/src/fill.cpp Outdated
Comment thread benchmarks/src/fill.cpp Outdated
Comment thread benchmarks/src/fill.cpp
Comment thread benchmarks/src/fill.cpp Outdated
Comment thread benchmarks/src/fill.cpp Outdated
Comment thread benchmarks/src/fill.cpp
Comment thread benchmarks/src/fill.cpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks! 😸 I pushed significant changes - please meow if you have concerns.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Initial Review to Ready To Merge in STL Code Reviews Apr 15, 2025
@barcharcraz

Copy link
Copy Markdown
Contributor Author

nah, lgtm.
However:

I don't really like pulling the allocators out into a template parameter, as I don't think it's worth multiplying the test matrix for them (although having some benchmarks use one and some the other probably was bad).

@AlexGuteniev

Copy link
Copy Markdown
Contributor

I don't really like pulling the allocators out into a template parameter, as I don't think it's worth multiplying the test matrix for them (although having some benchmarks use one and some the other probably was bad).

If there's little difference in performance between allocators, I'd just use the worse one (not_highly_aligned_allocator), to make AVX2 or AVX-512 vectorization, if they exist here, of less advantage.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) changed the title add std::fill benchmarks Add std::fill and std::fill_n benchmarks Apr 16, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

Sounds good to me since I saw no perf difference. I'll validate and push.

@barcharcraz

Copy link
Copy Markdown
Contributor Author

lgtm

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Ready To Merge to Merging in STL Code Reviews Apr 22, 2025
@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 cac14a0 into microsoft:main Apr 22, 2025
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews Apr 22, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for filling out our benchmark directory! ⏱️ 📈 😹

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

Labels

test Related to test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants