try to optimize diff_all