# Acceleration of Particle Swarm Optimization with AVX Instructions
## 3 Empirical Analysis Additionally, Experimental Procedure
\begin{table}
\begin{tabular}{l l l} \hline \hline  & **Benchmark Function** & **Range** \\ \hline f01 & Absolute & \([-100,100]\) \\ \hline f02 & Ackley & \([-32.77,32.77]\) \\ \hline f03 & Alpine & \([0,20]\) \\ \hline f04 & Egg holder & \([-512,512]\) \\ \hline f05 & Elliptic & \([-100,100]\) \\ \hline f06 & Griewank & \([-600,600]\) \\ \hline f07 & Hyperellipsoid & \([-5.12,5.12]\) \\ \hline f08 & Michalewicz & \([0,\pi]\) \\ \hline f09 & Norwegian & \([-1.1,1.1]\) \\ \hline f10 & Quadratic & \([-100,100]\) \\ \hline f11 & Quadratic & \([-1.28,1.28]\) \\ \hline f12 & Rastrigrin & \([-5.12,5.12]\) \\ \hline f13 & Rosenbrock & \([-30,30]\) \\ \hline f14 & Salomon & \([-100,100]\) \\ \hline f15 & Schaffer 6 & \([-100,100]\) \\ \hline f16 & Schwefel 1.2 & \([-100,100]\) \\ \hline f17 & Schwefel 2.6 & \([-100,100]\) \\ \hline f18 & Schwefel 2.13 & \([-\pi,\pi]\) \\ \hline f19 & Schwefel 2.21 & \([-100,100]\) \\ \hline f20 & Schwefel 2.22 & \([-10,10]\) \\ \hline f21 & Shubert & \([-10,10]\) \\ \hline f22 & Spherical & \([-5.12,5.12]\) \\ \hline f23 & Step & \([-100,100]\) \\ \hline f24 & Vincent & \([0.25,10]\) \\ \hline f25 & Weierstrass & \([-0.5,0.5]\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Benchmark functions. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dimension** & **Scalar [s]** & **Avavx [s]** & **Intavx [s]** & **Asmavx [s]** \\ \hline
8 & \(4.32\times 10^{-1}\) & \(3.54\times 10^{-1}\) & \(2.25\times 10^{-1}\) & \(2.32\times 10^{-1}\) \\ \hline
16 & \(7.32\times 10^{-1}\) & \(3.14\times 10^{-1}\) & \(2.85\times 10^{-1}\) & \(2.63\times 10^{-1}\) \\ \hline
32 & \(1.20\times 10^{0}\) & \(5.552\times 10^{-1}\) & \(5.32\times 10^{-1}\) & \(5.23\times 10^{-1}\) \\ \hline
64 & \(2.42\times 10^{0}\) & \(1.05\times 10^{0}\) & \(1.01\times 10^{0}\) & \(9.76\times 10^{-1}\) \\ \hline
128 & \(4.92\times 10^{0}\) & \(2.06\times 10^{0}\) & \(1.99\times 10^{0}\) & \(1.87\times 10^{0}\) \\ \hline
256 & \(9.92\times 10^{0}\) & \(4.10\times 10^{0}\) & \(3.96\times 10^{0}\) & \(3.84\times 10^{0}\) \\ \hline
512 & \(1.99\times 10^{1}\) & \(8.12\times 10^{0}\) & \(7.78\times 10^{0}\) & \(7.55\times 10^{0}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Runtime performances of various PSO versions (32 particles, complete test suite). last iteration. When the dimensionality doubles, the algorithm needs to compute twice the updates, and vice versa. The same condition is true for the number of particles. However, if we look closely at individual performance for each test function, we can see a significant difference in performance, especially for the lower numbers of dimensions and particles. As the numbers grow, the difference in runtime decreases. The architecture of AVX instruction could cause this--before execution of AVX instruction, the processor needs additional time. Fast switching between AVX instruction and scalar instruction causes another overhead. Table 4 summarizes average runtime for each test function. In this experiment, we performed 100 PSO runs with the same configuration of 128 dimensions and 32 particles. The remaining parameters used the values mentioned in Table 1.  
Figure 1: Runtime performance on benchmark suite—various configurations of particles, and dimensions. Figure 2: Runtime performance of PSO (Vincent function)—various configurations. The results in Table 4 show the highest similarity in performance of both implementations for test function number 24--the Vincent function. Figure 2 illustrates the runtime performances of various PSO configurations on the Vincent function. The graph shows similar performance in multiple settings. We selected the Vincent function with the highest similarity to mitigate the impacts of other factors. The final performance depends on memory allocation, data prefetching, loop unrolling, blocking, etc. Using the highest similarity, we could see the lowest expected increase in performance. The Intavx code with AVX intrinsics generally outperformed auto-vectorized code in most PSO problem configurations.