playMaker

Author Topic: [SOLVED] performance issues with broadcast events  (Read 4494 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
[SOLVED] performance issues with broadcast events
« on: May 17, 2011, 02:46:43 AM »
Hi,

 As the project grows, I start seeing latency when using broadcast action. It becomes a problem now. As Fsm relies on Events to communicate. Is there any plans to improve on the events system to let interested parties registering to events, that would prevent shaving to broadcast. Or maybe the api involved in gathering all fsm, etc etc could be improved to minimize the impact on the perfs.

I am currently trying to improve the code itself ( like calling only fsm with the given event ), but meanwhile, you might have suggestions.


 Bye,

 Jean
« Last Edit: May 17, 2011, 03:08:28 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: performance issues with broadcast events
« Reply #1 on: May 17, 2011, 03:08:06 AM »
Hi,

 Actually, it's the debug line to the console that was creating this latency :).

anyway, I think there is room for improvement, since a call is made to fsm that do not have the event in question. The thing is that fsm.Events is protected ( tried to implement a check in the action itself). How can I overcome this and scan or query a fsm if it has or not a given fsm?

 Bye,

 Jean

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: [SOLVED] performance issues with broadcast events
« Reply #2 on: May 24, 2011, 02:48:14 PM »
In 1.2 you can use fsm.HasEvent(eventName).

1.2 also eliminates string compares from runtime event handling, so you might see a performance boost with that.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: [SOLVED] performance issues with broadcast events
« Reply #3 on: May 25, 2011, 01:23:26 AM »
Hi Alex,

 Yes :) not only a perf boost but a more robust design not breaking because you renamed an event. Thanks :)