You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CircularBuffer uses modulo to handle index overruns of _tail and _head. Unless Buffersize is 2^x or some other magic number the compiler must make a division, which is pretty expensive in terms of computation power, even with hardware support.
As _tail and _head are only ever incremented by one, an if(_tail == BufferSize) {_tail = 0}; should suffice. This will provide much better performance, especially with -O0 and -O1.
I can provide a pull-request if requested.