<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62571>62571</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Optimize number of comparisons in associative containers assignment and copy
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++,
            performance
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ldionne
      </td>
    </tr>
</table>

<pre>
    When we copy construct or copy-assign a `std::map`, instead of doing something akin to `map.insert(begin, end)` (which requires a bunch of comparisons), we could copy the underlying RB tree without having to perform any comparisons, since we know the incoming tree is already structured appropriately.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxckk-L2zAQxT-NfBk2yFLsOAcfdrPkWuil57E0iacrS67-bEg_fZG9UFowWAx6v5mnN5gS3z3RKLo30b03WPIc4ugsB--pmYJ9jj9m8vAgMGF9ggk-5VhMhhC3ysuOAATRy5St0K9Cvy64il4KdQH2KRNaCDewgf0dUlgoz_WEH-whhypccD2wTxSzUMNEd_ZVS94KdRa9BKGGx8xmhki_CkdKgDAVb-bKNWFZMXIKPtXr6rJPW5zdZ84zQfGWonvWtt_fIEcieHCeQ8kw42ct5wArxVuIC6B__gu9QGJvqHI_fHhsRPYmLJuwwjgBukhon7C_T4lkAdc1hjUyZnLPQ2NHbc_6jA2NbT9odT7pXjbzqBTKI-lpkB2eutugre71IHWvza1Fc2p4VFJp2cmuPepeyoNs2-Nx6EkOE8nu1IqjpAXZHZz7XA4h3htOqdDYq-7UNg4ncmnLWCnHkxHqbfuUUBeh1Jdv9IZqrXtv4lhBL1O5J3GUjlNOf9GZs6Px25p54d8EviwTxf-CAPaAKQXDmPmzxuEzsqeYYF-YhXwG9HtETYlunHNeU10fdRXqeuc8l-lgwiLUtbb--r2sMfwkk4W6bhaTUNfN5Z8AAAD__4hX8HE">