# Acceleration of Particle Swarm Optimization with AVX Instructions
## 3 Empirical Analysis Additionally, Experimental Procedure  
This part aims to provide an empirical comparison of PSO implementation with AVX instructions. We tested the performance on a set of benchmark functions described below closely. We compared the algorithm's performance on four C++ implementations, which differ in just one detail. The scalar implementation uses a straightforward approach without any vector instructions. This implementation provides just baseline results for further experiments. Parallel variants use Advanced Vector Extensions (AVX2) to compute particle movement updates. This crucial feature is achieved with auto-vectorization, SIMD intrinsics and raw assembly instructions. The optimized code affects only the PSO algorithm itself (especially the velocity and position update), not the computation of the fitness function. Our goal was to monitor the change in algorithm performance, not the optimization of test functions. We executed the PSO algorithm 200 times for each benchmark function to obtain independent results. All algorithms used the same PSO settings and synchronous updates. The exact values of control parameters are contained in Table 1.  
We chose to follow the approach from [PERSON] [19] and used functions from the CEC2005 test suite, in combination with other standard benchmark functions. Table 2 lists the benchmark functions with their range constraints. We tested a few implementations of PSO, all implemented in C++. Each PSO run used specific settings of dimensions and number of particles for each experimental run. All PSO variants were optimized to achieve maximum performance and compiled with optimizations for speed. The first implementation used a scalar approach without any parallelization and served as an AVX-independent measure of performance. The second approach (Avavx) used optimized C++ code with enabled auto-vectorization capabilities of the compiler. Another variant (Intavx) relied on AVX intrinsics, which are C-style functions providing access to AVX instructions without the need to write assembly code. The last implementation (Asmavx) was C++ code combined with raw assembly code. For all implementations using specific AVX instructions, we optimized only the same crucial part of PSO computation. All benchmarks were performed on an Intel Core i7-4770K (4 physical, 8 logical cores) processor with 16 GB RAM, running Windows 10. The runtime performance on the complete test suite is provided in Table 3. The table shows the cumulative runtimes of various versions sharing the same configuration of 32 particles but having varying dimensionality for the test functions. Table 3 shows the performance boost provided by SIMD. All AVX versions easily outperformed the scalar implementation. We can see the performance change in low dimensions, where the auto-vectorized version struggled more than the intrinsic or assembly version of PSO. This could be caused by inefficient data fetching and cache missing. After processing larger chunks of data, the Avavx's version performance increases. The detailed performance comparison of various configurations is displayed Figures 1-3. As all parallel implementations outperformed the scalar version, we omitted details of its results. In the first experiment, we compared the runtimes of Intavx and Avavx code with the various configurations on the whole test suite. This experiment showed only slight differences between implementations. Figure 1 illustrates the PSO runs (with appropriate configurations) used on the whole test suite (cumulative sum of each test function run times). The differences between code variants were small, but the Intavx code slightly outperformed Avavx, and the average reduction in total runtime was 3.13%. The graph shows a linear increase in runtime as the dimensionality and particle number grow. The runtime measures the time from the initialization of the PSO till the