Skip to content

Commit

Permalink
Fix matching perf regression
Browse files Browse the repository at this point in the history
Introduced in ae8af88, this bug caused the default impl of search for patterns to bypass the discriminator index.
  • Loading branch information
mwillsey committed Apr 16, 2024
1 parent 6401363 commit 2f1514c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [Unreleased] - ReleaseDate
- Change the API of `make` to have mutable access to the e-graph for some [advanced uses cases](https://github.com/egraphs-good/egg/pull/277).

- Fix an e-matching performance regression introduced in [this commit](https://github.com/egraphs-good/egg/commit/ae8af8815231e4aba1b78962f8c07ce837ee1c0e#diff-1d06da761111802c793c6e5ca704bfa0d6336d0becf87fddff02d81548a838ab).

## [0.9.5] - 2023-06-29
- Fixed a few edge cases in proof size optimization that caused egg to crash.
Expand Down
9 changes: 2 additions & 7 deletions src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,9 @@ where

/// Search the whole [`EGraph`], returning a list of all the
/// [`SearchMatches`] where something was found.
/// This just calls [`search_eclass`] on each eclass.
///
/// [`search_eclass`]: Searcher::search_eclass
/// This just calls [`Searcher::search_with_limit`] with a big limit.
fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches<L>> {
egraph
.classes()
.filter_map(|e| self.search_eclass(egraph, e.id))
.collect()
self.search_with_limit(egraph, usize::MAX)
}

/// Similar to [`search`], but return at most `limit` many matches.
Expand Down

0 comments on commit 2f1514c

Please sign in to comment.