optimize touch_all_variants performance