<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - std::rotate can be order of magnitude faster, if it can allocate a buffer."
   href="https://bugs.llvm.org/show_bug.cgi?id=35614">35614</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::rotate can be order of magnitude faster, if it can allocate a buffer.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>denis.yaroshevskij@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi!

For one sided rotation you do optimize for one element on the stack:
<a href="https://github.com/llvm-mirror/libcxx/blob/master/include/algorithm#L2435">https://github.com/llvm-mirror/libcxx/blob/master/include/algorithm#L2435</a>

Actually this is a valid optimization for arbitrary number of elements and it
can give you an order of magnitude speed up.

Here is a very naive implementation with measurements:
<a href="http://quick-bench.com/KjyAe88UUBAjSmDAbUsbkt1mLxQ">http://quick-bench.com/KjyAe88UUBAjSmDAbUsbkt1mLxQ</a>

Is it ok for std::rotate to do this?
I'm happy to create a patch but some guidance on the benchmark and restrictions
would be nice.

Best,
Dennis</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>