-
Notifications
You must be signed in to change notification settings - Fork 251
Description
The Search
feature translates to the Like
operator. To provide a consistent experience, we had to implement the Like
in C# for the in-memory evaluations. Considering that this operator is quite powerful, implementing it turned out to be quite tricky. Initially, we had pure C# implementation that performed relatively well, but unfortunately, it failed for some scenarios. In the end, we ended up with Regex implementation.
Creating a regex on each evaluation is a heavy operation. The pattern is not static, so we won't be able to use source generators. The pattern is dynamic and arbitrary, the consumer might even compose it by an end-user input. We should introduce caching here. We can not cache all Regex objects, but we can try to reuse the most "recent" ones. We'll cache 10 of them. This might improve the performance within the same closed loop for the in-memory evaluator and validator.