Snowfakery icon indicating copy to clipboard operation
Snowfakery copied to clipboard

Remove some function calls on a hot code path

Open prescod opened this issue 3 years ago • 0 comments
trafficstars

Centralize all of the code for evaluating extremely simple expressions like:

field: A: blah

This used to be treated as a special case of

field: A: ${{blah}}

where the string evaluates to itself because it has no executable code in it. Instead, it now detects the simple case very early and bypasses all of the logic that treats it as an executable expression.

Evaluation of simple fields is at least 6% faster and probably much more.

prescod avatar Jan 27 '22 10:01 prescod