question

Jeremy R avatar image
0 Likes"
Jeremy R asked Phil BoBo commented

Export Code Profile

Is there a way to export the contents of the FlexScript Code Profile to an external file (e.g. as a .csv file)?

You cannot copy the contents of the FlexScript Code Profile, so I was hoping there was a way to export it. I did not find any mention of a way to export it in the documentation. I also tried to find it in the model tree to see if I could export it manually, but couldn't locate the node where the code profile is stored.

FlexSim 18.2.3
flexsim 18.2.3exportcode profile
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

. . .

0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo commented

No. The 18.2 FlexScript Code Profiler’s units were not accurate. They’re only useful for comparing calls within a given profiling session to each other. Exporting it doesn't make sense because comparing one run of it to another isn't accurate.

The timing shown isn’t an actual measuring of the execution time. It is an estimate based on sampling of what is getting called and how long it might have been in that function relative to another function. You shouldn’t use those numbers as a measurement of how long it was in that function. You should only use it as a guideline for how long functions ran relative to other functions to help direct you to what functions might be running slowly in your model. The 18.2 FlexScript Code Profiler was also very limited in its scope; it records only FlexScript code execution; other processing is not taken into account. For a given model, unless you have some really critical, poorly optimized FlexScript functions, the likelihood is that your model processing speed is more dependent on other processing than on FlexScript code execution.

We replaced this profiler entirely in FlexSim 20.1.0 with a different tool that more accurately records how much time the CPU spends in profiled functions while the model runs. See https://docs.flexsim.com/en/20.1/Reference/Tools/PerformanceProfiler/PerformanceProfiler.html

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeremy R avatar image Jeremy R commented ·

Thanks, I'll keep that and mind, and try to use FlexSim 20.1.0 or later when doing a code profile.

So with the new FlexSim Code Profile in 20.1.0, is it possible to export the results?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Jeremy R commented ·

Yes, with the new Performance Profiler, all of the recorded data is accessible in the tree in MODEL:/Tools/ProfileData. You can write a function to export that data if you want.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.