improve swapping performance