Currently SDE exposes a single entry point, run_model that takes a C string containing key:value pairs for the inputs, and returns a large C string containing tab-separated (and formatted) output variables. This leads to inefficiencies on the calling side because for every model run, the inputs need to be formatted into a new string, and (when compiled to JS/Wasm) a new output string object is created each time.
As a more efficient alternative, SDE should expose a new entry point that takes pre-allocated input and output buffers (malloc'd double buffers) and use those instead.
Currently SDE exposes a single entry point,
run_modelthat takes a C string containingkey:valuepairs for the inputs, and returns a large C string containing tab-separated (and formatted) output variables. This leads to inefficiencies on the calling side because for every model run, the inputs need to be formatted into a new string, and (when compiled to JS/Wasm) a new output string object is created each time.As a more efficient alternative, SDE should expose a new entry point that takes pre-allocated input and output buffers (malloc'd
doublebuffers) and use those instead.