microsoft / microsoft/STL

<functional>: Investigate other algorithms for Boyer-Moore delta2

Open
#727 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

The Rytter correction implemented in #724 may not be the end of the saga. As mentioned in https://github.com/microsoft/STL/pull/724#issuecomment-615047283 , Mehlhorn developed a simpler correction (according to Knuth), published by Smit in 1982 and (apparently) further corrected (!!!) by Mzali and Thiel in 1983. Then, https://github.com/microsoft/STL/pull/724#issuecomment-615246820 mentioned a paper by Wang, proposing a potentially superior algorithm (a brief scan indicates that it might be more code than what we currently have, but with possibly different performance characteristics), and also provides Aho's improved version of KMP77.

We may want to investigate these other algorithms, especially if they result in faster table construction for certain patterns. Although #724 enhances our test coverage, extreme caution is needed, given how paper after paper has gotten this wrong.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading #724 and its linked discussion, then review the papers and algorithms cited in this issue: Mehlhorn, Smit, Mzali and Thiel, Wang, and Aho. Compare their table-construction approaches and performance characteristics against the current implementation, using the coverage added by #724 to define what must remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.