Skip to content

Commit 5f349a5

Browse files
authored
Change EvalExpr.evalute to return Cows to avoid unnecessary clones (#291)
Refactors `EvalExpr`'s `evaluate` function to return a [`Cow`](https://doc.rust-lang.org/std/borrow/enum.Cow.html#). Expressions like paths and variable reference return a `Cow::Borrowed` value and value-generating expressions (e.g., `+`, `trim`, ||`, etc) return a `Cow::Owned` value. Locally, this results in a ~15% to ~30% speedup on evaluation benchmarks and ~40% speedup of the run of the entire conformance test suite.
1 parent 48b6d89 commit 5f349a5

File tree

1 file changed

+198
-172
lines changed

1 file changed

+198
-172
lines changed

0 commit comments

Comments
 (0)