for loop max performance for large arrays