https://bugs.llvm.org/show_bug.cgi?id=35614

            Bug ID: 35614
           Summary: std::rotate can be order of magnitude faster, if it
                    can allocate a buffer.
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: denis.yaroshevs...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Hi!

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

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:
http://quick-bench.com/KjyAe88UUBAjSmDAbUsbkt1mLxQ

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to