microsoft / microsoft/STL

Extending memcmp optimization to classes

Open
#1,591 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

With C++20 it's possible to default comparison operators. With has_unique_object_representations and an intrinsic to detect if type is trivially equality comparable (it has defaulted operator== and all of it's members are trivially equality comparable) we could greatly increase number of cases when equal uses memcmp.

It would be great if we could default operator== for types like tuple and pair, but I don't know if we can do that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the equal implementation and the C++20 comparison facilities relevant to defaulted operators, has_unique_object_representations, and trivial equality comparability. Investigate whether types such as tuple and pair can safely qualify for memcmp-based equality; done means the supported class cases and implementation direction are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.