perforamnce improvement for small buffer