A Transformation For Optimizing String-Matching Algorithms For Long Patterns
Author:
Open Access
- 28 June 2016
- journal article
- Published by Oxford University Press (OUP) in The Computer Journal
- Vol. 59 (12) , 1749-1759
Abstract
String-matching algorithms search for all the locations where some pattern string matches within another input string. These algorithms make extensive use of character-wise comparisons, which may be optimized in order to achieve better performance of the entire algorithm. In this article, we describe a code transformation aimed at improving the performance of the string-matching algorithms that incorporate comparison of buffers of characters. The suggested transformation optimizes the buffer comparison operation whose multiple invocations are required by the string-matching algorithms. The transformation incorporates a template, which is based on the notion of dynamic guards used in conjunction with the word-sized comparisons. The template when instantiated produces code that may perform the buffer comparison operation more efficiently than the original code. The suggested optimization approach is portable and results in an efficient execution of the string-matching code for different sizes of the input pattern. We perform experiments with icc and gcc compilers on the Intel Core processor-based system. Using the proposed code transformation applied to a large number of string-matching algorithms, the experimentation results show that the optimized string-matching code is able to achieve a significant speed-up over the original code.
Keywords
This publication has 26 references indexed in Scilit:
- The exact online string matching problemACM Computing Surveys, 2013
- Bit-Parallel Search Algorithms for Long Patterns2010
- Simple Optimal String Matching AlgorithmJournal of Algorithms, 2000
- String Matching in the DNA AlphabetSoftware: Practice and Experience, 1997
- Tuning the boyer‐moore‐horspool string searching algorithmSoftware: Practice and Experience, 1992
- Experiments with a very fast substring search algorithmSoftware: Practice and Experience, 1991
- A very fast substring search algorithmCommunications of the ACM, 1990
- Efficient randomized pattern-matching algorithmsIBM Journal of Research and Development, 1987
- Practical fast searching in stringsSoftware: Practice and Experience, 1980
- A fast string searching algorithmCommunications of the ACM, 1977