optimize BufGet
Optimize memory copy