Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce the reverse suffix literal optimization. #228

Merged
merged 1 commit into from
May 7, 2016
Merged

Conversation

BurntSushi
Copy link
Member

It's too good to pass up. This time, we avoid quadratic behavior
with a simple work-around: we limit the amount of reverse searching
we do after having found a literal match. If the reverse search ends
at the beginning of its search text (whether a match or not), then we
stop the reverse suffix optimization and fall back to the standard forward
search.

A benchmark was added that will experience serious slow downs if
quadratic behavior happens.

This reverts commit 50d991e.

It's too good to pass up. This time, we avoid quadratic behavior
with a simple work-around: we limit the amount of reverse searching
we do after having found a literal match. If the reverse search ends
at the beginning of its search text (whether a match or not), then we
stop the reverse suffix optimization and fall back to the standard forward
search.

This reverts commit 50d991e.

# Conflicts:
#	src/exec.rs
@BurntSushi BurntSushi merged commit e27b87a into master May 7, 2016
@BurntSushi BurntSushi deleted the revsuf branch May 7, 2016 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant