RAFCON icon indicating copy to clipboard operation
RAFCON copied to clipboard

Generation of state copy model for library models like those are needed

Open franzlst opened this issue 4 years ago • 2 comments

The issue is about the problem that by default RAFCON generates recusive all models for a library state into to last leaf state down to the last library hierachy. This not fully needed structure can extend the loading of a state machine with high library hierarchy depth and increase the consumed time easily by a factor of 3 to 10. This is impressive if a state machine with 1500+ state and 8+ library levels often takes 30s to 40s or even a minute instead of 5 to 10 seconds.

A first solution for this issue is already implemented but to continued improvement (and it decisions and stages) of this issue should be documented.

  • [x] a first step is to reduce the generation of the state copy models to the maximum visible library level and the show content flag -- this is already implemented
    • the respective commits can be already found in the develop branch, see 238a995011828b128da14d8b09fbeeca6a798444 and 1f4a70bb56234a5bcdc51d06c69aedbc079d6296
  • [ ] a second stage should be to generate the state copy model only if the state copy is accessed, which can create multiple side affects caused by the graphical viewer and loading procedure, during adding a library state or complex actions (of course all this is not covered by tests)
    • the implementation is already started in the a new branch deferred_loading which at the moment does not consider named out problems
    • [ ] one needed step is to reorganize the meta data and model handling between library model, state copy model and graphical viewer for the outcomes and data ports
      • here it is needed to check if
        • complex state machines with high library depth are loaded correctly
        • and if a add library state scale and takes over existing meta data from it state copy correctly
    • [ ] other step is to reorganize the recursive scaling of a state copy of library state for loading/generation on request
      • maybe scaling factors has to be put to temporary storage to continue using those or secure correct recalculation of those
      • therefore also the dependency between meta data loading, graphical viewer (its generation and adaptation of meta data) and library model and state copy models while generating a library state model and state copy has to be partly or fully resolved (those is different while adding a library state or only opening a state machine which include libraries)

Please add concerns and problems of your knowledge.

Originally created by @Rbelder at 2017-09-19 10:05:16+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

At the moment also the changes proposed for the branch deferred_loading are not working according the aimed direction of this issue. Still all state copy models seem to be generated recursively because the time it takes to load a bigger state machine with multiple library hierarchy levels is not reduced. This is related to the needed re-factoring mentioned for sub-task two.

I would admire that we write a test for the deferred/on request loading feature before merging it into the develop branch to final preserve the feature from becoming broken (the gained improvement will be a lot if we have made it so far and it would be a pity if any change to the models or meta data handling or similar would destroy it without being recognized).

But I would merge/release already the first stage/sub-task because the gain is reasonable for every user that is developing complex tasks.

Originally created by @Rbelder at 2017-09-19 13:24:57+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

Can we also discuss this issue in the next meeting? If there are any performance bottlenecks so far the user can also put the statemachines to an ssd partition of the computer which speeds up the loading of state machines by a factor of 2.

Originally created by @sebastian-brunner ([email protected]) at 2017-09-25 06:16:33+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst