JKISoftware / JKI-State-Machine-Objects

Object-oriented framework for LabVIEW based on the JKI State Machine
BSD 3-Clause "New" or "Revised" License
96 stars 55 forks source link

Slow loading of templates in SMO editor #51

Open ImreSzebelledi opened 6 years ago

ImreSzebelledi commented 6 years ago

Hi!

I've just started using JKI's SMO and it seems the editor is seriously struggling when loading the SMO templates (it takes almost 15-30secs to finish loading them). I dared to venture into to source code and found out that the reason is the LVClass.Open invoke node. Is there really no better way to get the class into memory and receive a reference to it? The "Get LV class default value" loads the class into memory seemingly faster but i have no idea how to get a reference to the Class it loaded. I switched off the loading of the classes to get the desciption and the loading time dropped to 5 secs. As all references are closed when opening the editor again, i have to wait again. I love the tool by the way but the 15-30sec waiting time was killing me.

Thank you!

-Imre

francois-normandin commented 6 years ago

Hi Imre, thanks for the feedback.

The only way to get a reference to the class library is through this invoke node. The Editor is loaded in a separate context (application instance) to be able to use scripting and edit the classes without locking them in both contexts (your project's and the editor's). If we used the "Get LV Class default value" or similar methods, we'd open up a second instance of the class and both would be locked (un-editable).

There is a caveat to using templates in the way it is currently implemented: the templates are saved and installed in LV2013 so that they can be shared by all versions of LabVIEW. This is a suboptimal solution which affects the load time as LabVIEW needs to recompile the templates often. As a temporary solution, you can open the source templates and save them in the version you are using. This will prevent you from using the templates for previous LabVIEW versions but will hopefully give you a boost in loading speed.

The good news is that there is a new version of the Editor in the works, one that will be much faster, especially as it will not be scanning the whole set of classes in memory after every action... It is not ready for prime time yet but getting close. The next editor release will not rely on templates, but rather on itemization of each components of the SMO.

Hope this help.

ImreSzebelledi commented 6 years ago

Hi Francois,

Thank you for your quick answer! I will definitely try to save the templates in my version and see whether i get a speed boost. Now i am trying to decide which framework to introduce to our daily development: Delacor QMH, Actor framework or the JKI SMO, and after a week of getting familiar with it, it seems SMO will be the winner. I will be looking forward for the new editor. Thank you very much for your awesome work!

-Imre

ImreSzebelledi commented 6 years ago

Hi Francois,

i saved the templates to my labview version (2015), and the speed boost is unbeliveable! It loads the editor almost instantenously so thank you very much!

-Imre