playMaker

Author Topic: PlaymerFSM.OnAfterDeserialize performances issues  (Read 1213 times)

ben

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
PlaymerFSM.OnAfterDeserialize performances issues
« on: September 28, 2017, 12:44:30 AM »
Hello,

I have an performance issue when instantiating objects with PlaymakerFSM component on it. Even simple FSM make a huge spike on CPU (something like 0.75 ms per FSM on PC, more like 1.5 ms on consoles...).
In the profiler the problem seems to come from "PlaymerFSM.OnAfterDeserialize".

The problem is the code is in playmaker dll, so I can't find what's wrong.
Is there any way to optimize that, remove it?



Thank in advance.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3431
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #1 on: September 28, 2017, 03:50:21 PM »
Hi, can you submit a bug report so we can get more system info (Unity version, Playmaker version etc.) We can then use the bug report to go back and forth a bit and figure out the problem (what you're describing sounds unusual).

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #2 on: September 28, 2017, 11:40:42 PM »
Hi,

 Do you have FsmObject variables or FsmArrays  with lots of content on these objects?

Can you make screenshots of the profiler? is it not an issue with an action on the fsm? or maybe you are running a loop of some sorts?


 Bye,

 Jean


ben

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #3 on: September 29, 2017, 01:21:16 AM »
Hi,

When I try to submit a bug report there is this error : "Error Submitting Report : Cannot connect to destination host."

My Unity version : 2017.1.f1 , playmaker : 1.8.5.f8

Here is an exemple of an object with 2 FSM with 10 events, 10 variables (except global ones), 10 states, where the spike occur. Here is a screenshot of the profiler :


The problem is just during the instantiate, not during the loop. It occur with differents FSM with differents actions. The Actions contains some FSMArray or FSMgameobject but all in variable mode, so empty at start.



« Last Edit: September 29, 2017, 01:29:18 AM by ben »

ben

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #4 on: October 02, 2017, 07:37:09 AM »
Is there a way to access Playmaker code to know where the problem exactly is?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #5 on: October 22, 2017, 11:52:18 PM »
Hi,

 PlayMaker core is not open source, but I think you should join the beta group ( I'll touch on this with Alex meanwhile). Would you be interested? As for the bug report, yes, good catch 2017.1 has issues, it works on 2017.2 maybe it's the same issue I had with Ecosystem, where the www class is broken. I have raised a ticket on this internally.

Instantiation of Fsm Component is known to be the performance sensitive part of PlayMaker because of the custom serialization system that has to be in place for PlayMaker to be visual. So this kind of reports do help a lot. I Also contacted Alex on this so that he can have a close look.

Thanks for your help :)

 Bye,

 Jean

 Bye,

 Jean

allornothing

  • Playmaker Newbie
  • *
  • Posts: 20
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #6 on: May 06, 2018, 09:20:31 AM »
Did anything happen with this? We're seeing some very poor performance on PlaymakerFSM.OnAfterDeserialize() (25kb / up to 4.2ms per entry) and it's killing our scene streaming.

Using Unity   2017.2.0p4  and Playmaker 1.8.5

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #7 on: May 06, 2018, 11:50:04 PM »
Hi,

Are you part of the beta? If no and you would like to, let me know.

Typically, in this kind of cases, a repro scene will help, maybe this prefab has an fsm that uses some Unity object class and it makes it a lot slower to work with or maybe sounds.

 but yeah, if you could explain in more details what this prefab is, it would help.

Bye,

 Jean

allornothing

  • Playmaker Newbie
  • *
  • Posts: 20
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #8 on: May 07, 2018, 02:50:37 AM »
Hey - not part of the beta no, but would be happy to. We're a little over halfway through a large console project, so depends how safely we can make the switch and still use in active development?

We have quite a lot of FSMs, with a wide mix of variables and complexities. The profiler won't let me target individual instances, but I would possibly say it could be every FSM in the scene that's just been loaded that is firing it off.

allornothing

  • Playmaker Newbie
  • *
  • Posts: 20
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #9 on: May 08, 2018, 09:21:14 AM »
Hi Jean

Just a little bump :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: PlaymerFSM.OnAfterDeserialize performances issues
« Reply #10 on: May 09, 2018, 12:46:05 AM »
Hi,

 To be part of the beta, you;ll need to pm me with a gmail address, we'll add you to the group.

serialization is dependant on what you serialize, so in order to be able to do anything here, we need a repro or more information. in your case, since it's linked to prefab youc an create a dummy scene that will load up each prefab one at a time, and then you can check which one takes the most perfs out and then check what data is in its fsms. and cut them down  until you find which ones are most impacting, this will help a great deal to know exactly what's going on and take appropriate steps.

 also, it goes without saying,but you should be using a pool manager, if you do, are you sure it's setup properly, this should improve this kind of performance impact by having already instancitiated a set of prefabs in the pool before it actually starts running.

 Bye,

 Jean