Optimize print buffer routine for debug.