Optimizing Packed String Matching on AVX2 Platform M. Akif Aydo˘ gmu¸ s 1,2[0000000314413650] and M.O˘ guzhan Külekci 1[0000000245836261] 1 Informatics Institute, Istanbul Technical University, Istanbul, Turkey aydogmusm@itu.edu.tr, kulekci@itu.edu.tr 2 TUBITAK, The Scientific and Technological Research Council Of Turkey, Kocaeli, Turkey Abstract. Exact string matching, searching for all occurrences of given pattern P on a text T , is a fundamental issue in computer science with many applica- tions in natural language processing, speech processing, computational biology, information retrieval, intrusion detection systems, data compression, and etc. Speeding up the pattern matching operations benefiting from the SIMD par- allelism has received attention in the recent literature, where the empirical results on previous studies revealed that SIMD parallelism significantly helps, while the performance may even be expected to get automatically enhanced with the ever increasing size of the SIMD registers. In this paper, we provide variants of the previously proposed EPSM and SSEF algorithms, which are orig- inally implemented on Intel SSE4.2 (Streaming SIMD Extensions 4.2 version with 128-bit registers). We tune the new algorithms according to Intel AVX2 platform (Advanced Vector Extensions 2 with 256-bit registers) and analyze the gain in performance with respect to the increasing length of the SIMD registers. Profiling the new algorithms by using the Intel Vtune Amplifier for detecting performance bottlenecks led us to consider the cache friendliness and shared-memory access issues in the AVX2 platform. We applied cache op- timization techniques to overcome the problems particularly addressing the search algorithms based on filtering. Experimental comparison of the new solutions with the previously known-to- be-fast algorithms on small, medium, and large alphabet text files with diverse pattern lengths showed that the algorithms on AVX2 platform optimized cache obliviously outperforms the previous solutions. Keywords: String Matching · AVX2 SIMD · Cache Optimization · Intel Vtune Amplifier 1 Introduction Finding all occurrences of given pattern on a text, named as exact string matching is one of the basic tasks in computer science. It has many applications in diverse fields such as natural language processing, speech processing, computational biology, information retrieval, intrusion detection systems, data compression etc. Nowadays most applications requiring string matching works with large datasets thus the speed of string matching is gaining importance. v as counting all the occurrences of a pat- tern P of length m in a text T of length n assuming m n, over a finite alphabet Σ. Numerous string matching algorithms have been presented since the 1970s with