<div dir="ltr">We&#39;ll put that in the paper if you&#39;re Ok with it. This sort of behavior makes it interesting to offer tool that has been optimized for the user&#39;s platform (client code stays stable). It seems to me to be an argument for standardizing the function.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 20 sept. 2023 à 17:39, Matt Bentley &lt;<a href="mailto:mattreecebentley@gmail.com">mattreecebentley@gmail.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Just as a follow-up,<br>
      I refined my benchmarks, and while my partition code works better
      on some platforms, it&#39;s not consistent.<br>
      <br>
      However, the destructive partitioning (move instead of swap)
      results are good vs non-destructive, at (on average across
      different numbers of elements up to 1000000) 2% faster for int, 8%
      faster for double and 40-byte structs, 40% faster for 490-byte
      structs, ie. scales with type sizeof and/or non-trivially-copyable
      status.<br>
    </p>
    <div>On 6/09/2023 11:43 am, Patrice Roy
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">These remarks make SG14 a fun place to be :)
        Thanks!<br>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">Le mar. 5 sept. 2023 à 19:03,
          Matt Bentley via SG14 &lt;<a href="mailto:sg14@lists.isocpp.org" target="_blank">sg14@lists.isocpp.org</a>&gt;
          a écrit :<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Thanks for that-</p>
            <p>it led me down a rabbithole where I realised I can
              improve upon the existing strategies used in
              std::partition across all of the 3 major vendors.<br>
              Cheers-<br>
            </p>
            <div>On 4/09/2023 2:17 pm, Edward Catmur via SG14 wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="auto">This is a pretty vague thought, but have
                you noticed the correspondence to the partition /
                stable_partition algorithms? partition is essentially a
                way to accomplish the swap part of a swap-and-pop, and
                stable_partition is more or less identical to remove_if,
                so it feels like maybe there should be an equivalent
                using move instead of swap that operates on
                iterators/ranges instead of containers, leaving two
                consecutive ranges where the first part contains the
                desired elements and the second is moved-from.
                <div dir="auto"><br>
                </div>
                <div dir="auto">Anyway, great work and thanks. </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Sun, Sep 3, 2023,
                  18:06 Matt Bentley via SG14 &lt;<a href="mailto:sg14@lists.isocpp.org" target="_blank">sg14@lists.isocpp.org</a>&gt;
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                  <div>
                    <p>Yeah there&#39;s a few issues, such as whether to
                      support deques, but I figured one thing at  a
                      time. Given lack of response, might be best to
                      discuss at next meeting.<br>
                      Can&#39;t use swap in the name as mentioned - as no
                      swaps occur.</p>
                    <p>Cheers for getting back to me.<br>
                    </p>
                    <div>On 4/09/2023 10:16 am, Patrice Roy wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">
                        <div>In PXXX, I put « <span style="font-size:11pt;line-height:107%;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">Move-With-Last-Swap /
                            Reorderase</span> » for the moment and we&#39;ll
                          find a better name if needed (it&#39;s a bit early
                          for that). I&#39;d focus on the technical issues
                          initially, and feel LEWG&#39;s mood for the name.<br>
                        </div>
                        <div><br>
                        </div>
                        <div>Thanks!<br>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">
                        <div dir="ltr" class="gmail_attr">Le jeu. 24
                          août 2023 à 20:07, Matt Bentley via SG14 &lt;<a href="mailto:sg14@lists.isocpp.org" rel="noreferrer" target="_blank">sg14@lists.isocpp.org</a>&gt;
                          a écrit :<br>
                        </div>
                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                          <div>
                            <p>Hi all-</p>
                            <p>as per the last meeting there was some
                              support for putting forward a proposal for
                              what I call reorderase (<a href="http://plflib.org/reorderase.htm" rel="noreferrer" target="_blank">plflib.org/reorderase.htm</a>)
                              but is really just an iteration of the
                              swap-and-pop idiom, optimized (no swap,
                              just move) and extended to range-erase and
                              std::erase_if/std::erase. See the page for
                              more information.<br>
                            </p>
                            <p>There was some discussion of this back in
                              2015 by Brent Freidman but he was focused
                              on the erase_if equivalents - which&#39;re the
                              worse-performing of the set.</p>
                            <p>I have a few questions before putting a
                              paper together, the first of which is
                              bikeshedding. I&#39;m pretty settled on the
                              name &#39;move_pop&#39;, for reasons which will
                              become clear, but I am open to
                              suggestions. Please let me know what you
                              think:<br>
                            </p>
                            <p><br>
                            </p>
                            <p>Names which aren&#39;t appropriate:</p>
                            <ul>
                              <li>I like portmanteau&#39;s but the standard
                                doesn&#39;t, so I&#39;m guessing &#39;reorderase&#39; is
                                out of the question; possibly unfair on
                                non-english speakers.</li>
                              <li>Anything with &#39;swap&#39; in it. Implies
                                operations which do not occur, also
                                implies allocation.</li>
                              <li>Anything with &#39;unstable&#39; in it - in
                                the case of the standard library the
                                term &#39;unstable&#39; is not defined or used,
                                only the term &#39;stable&#39; is defined. In
                                addition the word has a bad connotation
                                in terms of programs, and algorithms are
                                assumed to be unstable by-default where
                                &#39;stable&#39; is not used in functions.</li>
                              <li>Anything long like &#39;unstable&#39;,
                                &#39;disordered&#39;, &#39;unordered&#39;, &#39;reordering&#39;,
                                etc; at least for the singular/range
                                reorderase equivalents. They are
                                expected to be commonly-used functions,
                                so long is Bad. I don&#39;t mind a longer
                                title on the erase_if/remove_if
                                equivalent as this is expected to be
                                less-frequently used.</li>
                              <li>Anything involving &#39;back&#39; or &#39;front&#39;.
                                A deque would want to pop from the front
                                if <code>location == begin()</code> or
                                <code>first == begin()</code> <code>(in
                                  reorderase(first, last))</code>, and
                                we would want the name to be consistent
                                between deques and
                                vectors/inplace_vectors (if we want to
                                support deques).</li>
                            </ul>
                            <p>Potential names:</p>
                            <ul>
                              <li>move_pop/move_and_pop (the standard
                                currently has about 1 other function
                                which uses _and_ but it seems an
                                unnecessary elongation) - this is good
                                enough, and short, and brings in the
                                &#39;pop&#39; association with being quick/O(1).</li>
                              <li>...? Suggestions?</li>
                              <li>For an std::erase_if/std::erase
                                equivalent, using the &#39;pop&#39; thing won&#39;t
                                work, as erase_if already does this
                                (moves the stuff to the back, erases
                                it). If we go with a
                                remove_if-equivalent implementation
                                instead of erase_if, pop also doesn&#39;t
                                work because remove_if doesn&#39;t erase/pop
                                anything. I&#39;m leaning towards (assuming
                                a remove_if equivalent member function
                                instead of erase_if)
                                &#39;unordered_remove_if&#39;/&#39;unordered_remove&#39;,
                                or
                                &#39;disordered_remove_if&#39;/&#39;disordered_remove&#39;.
                                I prefer the latter is it clearly
                                implies that there <i>will be</i> a
                                disruption of order in the use of this
                                function.</li>
                            </ul>
                            <p><br>
                            </p>
                            <p>M@<br>
                            </p>
                          </div>
_______________________________________________<br>
                          SG14 mailing list<br>
                          <a href="mailto:SG14@lists.isocpp.org" rel="noreferrer" target="_blank">SG14@lists.isocpp.org</a><br>
                          <a href="https://lists.isocpp.org/mailman/listinfo.cgi/sg14" rel="noreferrer noreferrer" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/sg14</a><br>
                        </blockquote>
                      </div>
                    </blockquote>
                  </div>
                  _______________________________________________<br>
                  SG14 mailing list<br>
                  <a href="mailto:SG14@lists.isocpp.org" rel="noreferrer" target="_blank">SG14@lists.isocpp.org</a><br>
                  <a href="https://lists.isocpp.org/mailman/listinfo.cgi/sg14" rel="noreferrer noreferrer" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/sg14</a><br>
                </blockquote>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
SG14 mailing list
<a href="mailto:SG14@lists.isocpp.org" target="_blank">SG14@lists.isocpp.org</a>
<a href="https://lists.isocpp.org/mailman/listinfo.cgi/sg14" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/sg14</a>
</pre>
            </blockquote>
          </div>
          _______________________________________________<br>
          SG14 mailing list<br>
          <a href="mailto:SG14@lists.isocpp.org" target="_blank">SG14@lists.isocpp.org</a><br>
          <a href="https://lists.isocpp.org/mailman/listinfo.cgi/sg14" rel="noreferrer" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/sg14</a><br>
        </blockquote>
      </div>
    </blockquote>
  </div>

</blockquote></div>

