SimConnect + WASM combined project using VS2019

You guessed it right, it does exactly as it looks like: it parses an XML expression and return it in a more compact format, which can be used as input for the execute_calculator_code call. This should be used to optimize an XML expression that rarely changes so, you precompile it once, and store the compressed version and always use that one, until the XML expression changes for some reason, so you precompile it again.

Although execute_calculator_code is very straight forward and easy to use, it might not be the fastest way as already mentioned by @Umberto67 in this post. I haven’t tested my code with several 100 registered variables that need to be checked every frame. But the code could be optimized by using the gauge API functions check_named_variable, get_named_variable_value and set_named_variable_value.

Yes, you should try to use the Gauge API function when possible. Using execute_calculator_code JUST to read or write an L: variable is a waste of performance, the calculator code parser should only be used for complex XML expressions, possibly together with the precompile.

Here’s a link to an 8-year old post of mine on fsdeveloper, in which I explained how to create a C++ class to easily handle L: variables, mostly as an excuse to demonstrate some OOP techniques:

The attached code is C++, so I guess it should be fairly easy to adapt it to a WASM module.

1 Like