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 i7 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.
Author supplied keywords
Cite
CITATION STYLE
Khan, M. A. (2016). A transformation for optimizing string-matching algorithms for long patterns. Computer Journal, 59(12), 1749–1759. https://doi.org/10.1093/comjnl/bxw023
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.