Performance-optimized array sum