Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
FeatureScript Profiler discussion
kevin_o_toole_1
Onshape Employees, Developers, HDM Posts: 565
Hey FeatureScript authors,
We're happy this week to have released the FeatureScript profiler, Onshape's tool for viewing timing data for individual execution steps inside your custom features (you can check out a quick video here or the documentation here).
We're already eating our own dogfood and using this tool to help speed up features in our standard library, but fundamentally, this was created to be a tool for the whole FeatureScript community. We hope it provides rapid feedback for FeatureScript authors, and helps improve performance in the wide variety of custom features floating around the Onshape ecosystem.
@jon_hirschtick likes to say "Testing makes fools of all of us", and in my experience that absolutely applies to profiling.
So, I ask you all, when looking at your timings, what has surprised you? What parts run slow, and what runs fast? What code changes have you made to successfully improve performance?
Happy scripting!
Kevin
We're happy this week to have released the FeatureScript profiler, Onshape's tool for viewing timing data for individual execution steps inside your custom features (you can check out a quick video here or the documentation here).
We're already eating our own dogfood and using this tool to help speed up features in our standard library, but fundamentally, this was created to be a tool for the whole FeatureScript community. We hope it provides rapid feedback for FeatureScript authors, and helps improve performance in the wide variety of custom features floating around the Onshape ecosystem.
@jon_hirschtick likes to say "Testing makes fools of all of us", and in my experience that absolutely applies to profiling.
So, I ask you all, when looking at your timings, what has surprised you? What parts run slow, and what runs fast? What code changes have you made to successfully improve performance?
Happy scripting!
Kevin
Tagged:
1
Comments
Great feature and I'm sure I'll be using it soon.
You guys are probably way ahead of me but is it possible to use it with the native features too? I'd love to be able to see which features in my model take the longest time so that I could do my part to improve initial load and rebuild times.
Keep up the good work
Cheers, Owen S.
HWM-Water Ltd
I have copied Onshape's FeatureScript code of Extrude and Thicken from the public document "std". You can merge this 2 FeatureScript into one, but I just have created 2 branchs in the document:
- Extrude (36 ms) https://cad.onshape.com/documents/58e1abcdee7f970fe47eb60d/w/e87c6e8367495186288f7f0b/e/3f0d19e679bc131b56d16326
- Thicken (33 ms) https://cad.onshape.com/documents/58e1abcdee7f970fe47eb60d/w/65013b0fde29375b5566b0e2/e/7f3601973e0bdd20c419ade9
It is not a big difference, but Thicken is 3 ms faster.Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
HWM-Water Ltd
@emagdalenaC2C
There is not much to win in 3 ms. Even in a FeatureScript without code like this, you get 30 ms:
FeatureScript 543;
import(path : "onshape/std/geometry.fs", version : "543.0");
annotation { "Feature Type Name" : "Extrude Light" }
export const extrudeLight = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
// Define the parameters of the feature type
}
{
// Define the function's action
});
However, in the image below you can see the result of the FeatureScript profile for a very complete FeatureScript that creates 32 cut extrudes on several solids and also creates 35 parts and 28 mate connectors in a single feature in a Part Studio.
FeatureScript profile will be of great help to reduce that 7.82 seconds and improve user experience.
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común