FlexScript and DLL

FlexScript and DLL

lucas_klein
Not applicable
16 Views
2 Replies
Message 1 of 3

FlexScript and DLL

lucas_klein
Not applicable

[ FlexSim 16.0.8 ]

Dear all,

As suggested by @phil.bobo I am coming to this topic to detail a question that I had with the use of DLL and performance of the model. Follow attached a .zip archive that contains two simple models to represent the model I was working on. One of them uses DLL and the other does use FlexScript code.

In this model I constantly call a user event (0.2 second repeat time) that colors an object in my model, the DLL have exactly the same code that is in the User Event Script of the "not-DLL model". According with some tests made, the DLL had a slower execution than FlexScript. Follow attached also in this zip a few prints showing the execution time of the codes in FlexScript Code Profiling and also by a realTime execution, the realTime code was hand developed to measure time and is inside the Model Triggers "OnRunStart" and "OnRunStop"

dll-test.rar

0 Likes
Accepted solutions (1)
17 Views
2 Replies
Replies (2)
Message 2 of 3

philboboADSK
Autodesk
Autodesk
Accepted solution

If you build the DLL in release mode, then the execution is faster with the DLL.

Results on my computer:

In 16.0.8, 4 seconds with the Release Mode DLL, 6 seconds with FlexScript, and 10 seconds with the Debug DLL.

In 17.0.3, 4 seconds with the Release Mode DLL, 4 seconds with FlexScript, and 10 seconds with the Debug DLL.

5913-release-mode.png

Also, the size of the DLL shrinks from 1,199 KB to 215 KB when you build in Release Mode rather than Debug Mode.



Phil BoBo
Sr. Manager, Software Development
Message 3 of 3

lucas_klein
Not applicable

Thanks @phil.bobo it worked here. Good to know about those differences between building with Debug and Release.