FastStringSearch

From MediaWiki.org
Jump to navigation Jump to search

FastStringSearch is a PHP extension for fast string search and replace for PHP 5.4 and earlier. In PHP 5.5+ and HHVM, the native strtr and str_replace functions have been significantly improved. This extension uses a Commentz-Walter style algorithm for multiple search terms, or a Boyer-Moore algorithm for single search terms.

As of MediaWiki 1.27, this extension is no longer promoted.

History[edit]

It was previously used by the StringUtils and ReplacementArray classes in MediaWiki as alternative for PHP's strtr, which was extremely slow in certain cases prior to PHP 5.5. Chinese script conversion is one of those cases. As of MediaWiki 1.26 if you are using PHP 5.5 or higher, MediaWiki will use the default strtr implementation instead of FSS (git #a37e25c3). As of MediaWiki 1.27, it no longer looks for FSS due to requiring a minimum of PHP 5.5 (git #b41307ac).

See also[edit]