Get the latest tech news

SIMD-friendly algorithms for substring searching (2016)


Popular programming languages provide methods or functions which locate a substring in a given string. In C it is the function strstr, the C++ class std::string has the method find, Python's string has methods pos and index, and so on, so forth.

Author:Wojciech MuĊ‚aAdded on:2016-11-28Updated on:2018-02-14 (spelling), 2017-04-29 (ARMv8 results) Popular programming languages provide methods or functions which locate a substring in a given string. During past decades several algorithms to solve this problem were designed, an excellent page by Christian Charras and Thierry Lecroq lists most of them(if not all). There is a short chain of dependencies: read char, compare it, conditionally jump, which make hard to utilize out-of-order execution capabilities present in a CPU.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of SIMD

SIMD

Photo of friendly algorithms

friendly algorithms

Related news:

News photo

21 GB/s CSV Parsing Using SIMD on AMD 9950X

News photo

Compiling Array Languages for SIMD [pdf]

News photo

Promising results from DeepSeek R1 for code