Skip to content

Conversation

@vmichal
Copy link
Contributor

@vmichal vmichal commented Jan 7, 2026

Please note that there is some ongoing conversation and unanswered questions in #5992, so this is likely not the final state of this PR.

Optimize lookups in non-multi containers:

  • count() is the same as contains() when searched key is not generic

  • Optimize equal_range() when its length is at most one and searched key is not generic

  • Don't construct full key-value iterators in contains()

  • Delay construction of full key-value iterators in _Flat_map_base::_Find()

  • Shrink bounds for binary search in _Flat_map_base::_Emplace_hint

  • Introduce helper _Flat_map_base::_Iterator_from_key_iterator for simpler conversion key_container_type::(const_)iterator -> flat_map::(const_)iterator

  • Replace all calls to _RANGES::lower_bound and similar with _STD versions (see discussion https://discord.com/channels/737189251069771789/832305953562427513/1458509280184369246)

Resolves #5992

@vmichal vmichal requested a review from a team as a code owner January 7, 2026 00:25
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Jan 7, 2026
@StephanTLavavej StephanTLavavej self-assigned this Jan 7, 2026
@StephanTLavavej StephanTLavavej added performance Must go faster flat_meow C++23 container adaptors labels Jan 7, 2026
@StephanTLavavej StephanTLavavej removed their assignment Jan 8, 2026
@StephanTLavavej StephanTLavavej moved this from Initial Review to Merging in STL Code Reviews Jan 8, 2026
@StephanTLavavej StephanTLavavej merged commit f8ff3c6 into microsoft:feature/flat_map Jan 8, 2026
45 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Jan 8, 2026
@StephanTLavavej
Copy link
Member

🎉

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

Labels

flat_meow C++23 container adaptors performance Must go faster

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants