This example above first creates an instance of Expression using a valued constructor. This constructor takes a string as parameter.
Then the method Evaluate() is called to parse the string, and returns the actual value represented by the string.

Expression caching

When Evaluate() is called on an expression, it is compiled once. If the same expression is reused the compilation is not executed again. Thus you can reuse
Expression instances by changing the parameters, and you will gain in performance because only the trasversal of the expression tree will be done.

Moreover, each compiled expression is cached internaly, which means you don't even have to care about reusing an
Expression instance, the framework will do it for you. The cache is automatically cleaned like the GC does when an Expression is no more used, or memory is needed (i.e. using
WeakReference).

You can disable this behavior at the framework level by setting false to CacheEnabled.

Expression.CacheEnabled = false;

You can also tell a specific Expression instance not to be taken from the cache.