It depends on what you mean by "helps."
The idea behind such caching is that it will be faster than validating an expression. My first reaction to this is βit will probably be even slowerβ, but in 99% of cases such intuitive guesses are wrong, so let them just ignore it for now.
Caching is a compromise. You will enter the overhead of the memory (for the dictionary) plus the time required to create the dictionary, in the hope that the ToString plus dictionary search operation will be faster than checking the expression that is worth the cost (plus increasing complexity). Even so, a faster search will not matter at all unless you do it in a large loop somewhere. Is this true in your case? If not, you should not worry.
Now, if you are writing a universal library, you do not know how users of this library will want to use it. Perhaps some of them will actually make such calls in a loop. In this case, it would be nice to close your back and try to cache; but it would still be a bad decision to implement caching for an unlikely scenario, if that worsens your more likely scenario.
And of course, judging whether caching will be for better or for worse should always be done by measuring.
source share