Heavily improved/optimized buffer swapping.