STD vs Custom FeatureScript Speed?
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:

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

I have some hypotheses:
- "custom" FeatureScripts run in an interpreted-at-run-time environment, whereas the standard code is somehow compiled (to WASM?)
- There's something about including the other standard bits of the library which is slower for custom code vs the standard code
- The way the timing is measured is not consistent between standard and custom
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
Tagged:
0
Comments
-
I'm going to guess it's the same effect as here: https://forum.onshape.com/discussion/16497/fs-speed-of-functions-defined-in-versioned-document-versus-same-document
Of your hypotheses, definitely not #1 or #3. There is no WASM involved -- FeatureScript runs on the server (you may be interested in https://www.onshape.com/en/resource-center/videos/onshape-live-21-under-the-hood-how-onshapes-cloud-architecture-actually-works).Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0

