This work presents a technique for the acceleration of gradient-based algorithms that employ finite differences in the calculation of the gradient for the optimization of array antennas. It is based on differential contributions, which takes advantage of the fact that when an array is optimized, each element is analyzed independently from the rest. Thus, the computation of the gradient of the cost function, which is typically the most time consuming operation of the algorithm, can be accelerated. A time cost study is presented and the technique is implemented, as an example, in the generalized Intersection Approach algorithm for array optimization in near and far fields. Several syntheses are performed to assess the improvement of this technique. In the far field, it is compared for periodic and aperiodic arrays using different approaches for the computation of the gradient, including the analytic derivative. A reflectarray is also optimized in the near field with the goal of improving its quiet zone. The technique of differential contributions shows important reductions in the time per iteration in all three syntheses, specially in that of aperiodic arrays and near field optimization, where the time saved in the evaluation of the gradient is greater than 99%.