You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,18 @@ By default `LambdaParser` uses `ValueComparer` for values comparison. You can pr
38
38
var valComparer = new ValueComparer() { NullComparison = ValueComparer.NullComparisonMode.Sql };
39
39
var lambdaParser = new LambdaParser(valComparer);
40
40
```
41
+
### Caching Expressions
42
+
43
+
The `UseCache` property determines whether the `LambdaParser` should cache parsed expressions. By default, `UseCache` is set to `true`, meaning expressions are cached to improve performance for repeated evaluations of the same expression.
44
+
45
+
Therefore, using a singleton instance of `LambdaParser` is recommended, rather than creating a new instance each time.
46
+
47
+
You can disable caching by setting UseCache to false if you want to save memory, especially when evaluating a large number of unique expressions.
48
+
49
+
```csharp
50
+
varlambdaParser=newLambdaParser();
51
+
lambdaParser.UseCache=false;
52
+
```
41
53
42
54
## Who is using this?
43
55
NReco.LambdaParser is in production use at [SeekTable.com](https://www.seektable.com/) and [PivotData microservice](https://www.nrecosite.com/pivotdata_service.aspx) (used for user-defined calculated cube members: formulas, custom formatting).
0 commit comments