add batch save for better io performence,and remove some debug codes