Skip to main content

Optimizing Packed String Matching on AVX2 Platform

  • Conference paper
  • First Online:
  • 461 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11333))

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 applications 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 parallelism 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 originally 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 optimization 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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Durian, B., Holub, J., Peltola, H., Tarhio, J.: Tuning BNDM with q-grams. In: Proceedings of the Workshop on Algorithm Engineering and Experiments (ALENEX), pp. 29–37 (2009)

    Google Scholar 

  2. Peltola, H., Tarhio, J.: Variations of forward-SBNDM. In: Proceedings of the Prague Stringology Conference 2011, Prague, Czech Republic, 29–31 August 2011 (2011)

    Google Scholar 

  3. Durian, B., Holub, J., Peltola, H., Tarhio, J.: Improving practical exact string matching. Inf. Process. Lett. 110(4), 148–152 (2010)

    Article  MathSciNet  Google Scholar 

  4. Allauzen, C., Crochemore, M., Raffinot, M.: Factor Oracle: a new structure for pattern matching. In: Pavelka, J., Tel, G., Bartošek, M. (eds.) SOFSEM 1999. LNCS, vol. 1725, pp. 295–310. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-47849-3_18

    Chapter  Google Scholar 

  5. Cantone, D., Faro, S.: Searching for a substring with constant extra-space complexity. In: Ferragina, P., Grossi, R. (eds.) Proceedings of Third International Conference on Fun with Algorithms, pp. 118–131 (2004)

    Google Scholar 

  6. Knuth, D.E., Morris Jr., J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)

    Article  MathSciNet  Google Scholar 

  7. Cantone, D., Faro, S., Pavone, A.: Speeding up string matching by weak factor recognition. In: Stringology, pp. 42–50 (2017)

    Google Scholar 

  8. Faro, S.: Evaluation and improvement of fast algorithms for exact matching on genome sequences. In: Botón-Fernández, M., Martín-Vide, C., Santander-Jiménez, S., Vega-Rodríguez, M. (eds.) AlCoB 2016. LNCS. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-38827-4_12

    Chapter  Google Scholar 

  9. Navarro, G., Raffinot, M.: Fast and flexible string matching by combining bit-parallelism and suffix automata. ACM J. Exp. Algorithmics (JEA) 5, 4 (2000)

    Article  MathSciNet  Google Scholar 

  10. Tarhio, J., Holub, J., Giaquinta, E.: Technology beats algorithms (in exact string matching). CoRR, abs/1612.01506 http://arxiv.org/abs/1612.01506 (2016)

  11. Kulekci, M.O.: Filter based fast matching of long patterns by using SIMD instructions. In: Holub, J., Zdarek, J. (eds.) Proceedings of the Prague Stringology Conference 2009. Czech Technical University in Prague, Czech Republic, pp. 118–128 (2009)

    Google Scholar 

  12. Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. Math. Comput. 31(2), 249–260 (1987)

    Article  MathSciNet  Google Scholar 

  13. Boyer, R.S., Moore, J.S.: A fast string searching algorithm. Commun. ACM 20(10), 762–772 (1977)

    Article  Google Scholar 

  14. Thathoo, R., Virmani, A., Lakshmi, S.S., Balakrishnan, N., Sekar, K.: TVSBS: a fast exact pattern matching algorithm for biological sequences. Curr. Sci. 91(1), 47–53 (2006)

    Google Scholar 

  15. Faro, S., Külekci, M.O.: Fast multiple string matching using streaming SIMD extensions technology. In: Calderón-Benavides, L., González-Caro, C., Chávez, E., Ziviani, N. (eds.) SPIRE 2012. LNCS, vol. 7608, pp. 217–228. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-34109-0_23

    Chapter  Google Scholar 

  16. Faro, S., Lecroq, T., Borzi, S., Di Mauro, S., Maggio, A.: The string matching algorithms research tool. In: Proceedings of Stringology, pp. 99–111 (2016)

    Google Scholar 

  17. Faro, S.: Exact online string matching bibliography. CoRR, abs/1605.05067 http://arxiv.org/abs/1605.05067 (2016)

  18. Faro, S., Lecroq T.: The exact string matching problem: a comprehensive experimental evaluation. CoRR, abs/1012.2547 http://arxiv.org/abs/1012.2547 (2010)

  19. Faro, S., Lecroq, T.: The exact online string matching problem: a review of the most recent results. ACM Comput. Surv. 45(2), 13 (2013)

    Article  Google Scholar 

  20. Faro, S., Lecroq, T.: A fast suffix automata based algorithm for exact online string matching. In: Moreira, N., Reis, R. (eds.) CIAA 2012. LNCS, vol. 7381, pp. 149–158. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31606-7_13

    Chapter  MATH  Google Scholar 

  21. Faro, S., Lecroq, T.: Efficient variants of the backward-oracle-matching algorithm. In: Proceedings of the Prague Stringology Conference, pp. 146–160. Czech Technical University in Prague, Czech Republic (2008)

    Google Scholar 

  22. Faro, S., Külekci, M.O.: Fast packed string matching for short patterns. In: Sanders, P., Zeh N. (eds.) Proceedings of the 15th Meeting on Algorithm Engineering and Experiments, ALENEX. SIAM, New Orleans, LA, USA, pp. 113–121 (2013)

    Google Scholar 

  23. Faro, S.: A very fast string matching algorithm based on condensed alphabets. In: Dondi, R., Fertin, G., Mauri, G. (eds.) AAIM 2016. LNCS, vol. 9778, pp. 65–76. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41168-2_6

    Chapter  Google Scholar 

  24. Ladra, S., Pedreira, O., Duato, J., Brisaboa, N.R.: Exploiting SIMD instructions in current processors to improve classical string algorithms. In: Morzy, T., Härder, T., Wrembel, R. (eds.) ADBIS 2012. LNCS, vol. 7503, pp. 254–267. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-33074-2_19

    Chapter  Google Scholar 

  25. Chhabra, T., Faro, S., Külekci, M.O., Tarhio, J.: Engineering order-preserving pattern matching with SIMD parallelism. Softw. Pract. Exper. 47, 731–739 (2017). https://doi.org/10.1002/spe.2433

    Article  Google Scholar 

  26. https://software.intel.com/en-us/vtune-amplifier-help-intel-processor-events-reference

Download references

Acknowledgements

Computing resources used in this work were provided by the National Center for High Performance Computing of Turkey (UHeM) under grant number 4004492017.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mehmet Akif Aydoğmuş .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Aydoğmuş, M.A., Külekci, M.O. (2019). Optimizing Packed String Matching on AVX2 Platform. In: Senger, H., et al. High Performance Computing for Computational Science – VECPAR 2018. VECPAR 2018. Lecture Notes in Computer Science(), vol 11333. Springer, Cham. https://doi.org/10.1007/978-3-030-15996-2_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-15996-2_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-15995-5

  • Online ISBN: 978-3-030-15996-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics