std::move() as performance bottleneck?
问题 I have a custom ringbuffer implementation which uses a normal array allocated via new [] , and then uses std::move to move elements into the array. Here is the implementation of my push() method: void push(value_type&& value) { _content[_end] = std::move(value); // 9.2% of execution is spend here increment(); // 0.6% here } The objects I'm moving into the array are basically just a pointer and a std::unique_ptr : struct Task { Task() {} Function function; Batch *batch; }; And Function looks