STD vs Custom FeatureScript Speed?

S1mon
S1mon Member Posts: 4,638 PRO
In the process of investigating Bridging Curves, I noticed that copying a feature from the STD library and making minor modifications made it ~3x slower. I just did a test where I have my code (which has a few simple math changes), and the STD code where the only change is to add debug lines during edit, and then the standard Bridging Curve (in order below).



These are all set to G2G2 and are using essentially the same curves as inputs.



I have some hypotheses:

  1. "custom" FeatureScripts run in an interpreted-at-run-time environment, whereas the standard code is somehow compiled (to WASM?)
  2. There's something about including the other standard bits of the library which is slower for custom code vs the standard code
  3. The way the timing is measured is not consistent between standard and custom
Is there anything we can do differently to make custom FeatureScripts run with the same performance as the standard ones?

Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

Tagged:

Comments