playMaker

Author Topic: ArrayMaker : grave List Count performance issue  (Read 2566 times)

kiriri

  • Hero Member
  • *****
  • Posts: 506
ArrayMaker : grave List Count performance issue
« on: October 23, 2012, 07:03:25 AM »
Hey Jean (or whoever else who knows his way around arrayMaker)
where can I find the Count function for lists? I looked at the action, at the different collection etc scripts, but can't find the real function. I need to change it since I got a game which generally runs at 700 fps. If I count a list with 2 items each frame, my frame rate drops to 7fps . Something's wrong there I guess :D .
Would be great if you could point the right script out to me.
Cheers,
kiriri

PS: I followed the scripts and all its' extensions until I reached FsmStateAction. I couldn't find that one though :D
« Last Edit: October 23, 2012, 07:08:46 AM by kiriri »
Best,
Sven

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: ArrayMaker : grave List Count performance issue
« Reply #1 on: October 23, 2012, 07:51:31 AM »
Hi,

 ok, the code is in the action itself really, the action script is called ArrayListCount

and I did have a look, and I am very surprised you get such a bad performance drop. I did a test here, and it just has no impact at all. I mean nothing....

 I am simple checking is the arrayList exists and then call the native function to count that array, so I am not sure what's going on on your project or tests, but I would be inclined to think that the performance hit is somewhere else. What is happening as you count, that is not happening when you don't.

Have you also noticed that I have implemented events for when items are added, set and removed? simply enable events in the arraylist component interface

bye,

 Jean


kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: ArrayMaker : grave List Count performance issue
« Reply #2 on: October 23, 2012, 09:18:25 AM »
the reason why I'm so convinced that it's the count action is that it's in a loop with a couple of other actions. If I disable the Count action, the performance drop disappears. I'll see why it would cause such a drop all of the sudden. I managed to get up to 40 fps by entering a reference. Still a heavy loss :S
Best,
Sven

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: ArrayMaker : grave List Count performance issue
« Reply #3 on: October 23, 2012, 11:54:23 AM »
I'm a bit concerned now: I tested the very same project on my desktop machine and on my android phone, and both run flawlessly. No lag whatsoever. However, my laptop hits a horrible frame drop. Any idea what could cause this? Could it be an old CPU (intel centrino)? Maybe there's a compiler issue which doesn't take in the older CPUs.

PS: I had a look at the ArrayListCount action before, the only real line of code is "proxy.arrayList.Count" . Where can I find the definition of .Count ? It's in no class which the script extends, and grepping didn't help either. It can't be the native UnityEngine len (list.Count), can it?
« Last Edit: October 23, 2012, 02:00:07 PM by kiriri »
Best,
Sven

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: ArrayMaker : grave List Count performance issue
« Reply #4 on: October 24, 2012, 02:57:37 AM »
Hi,

 The definition of .Count is within .net itself:

http://msdn.microsoft.com/en-us/library/system.collections.arraylist.count.aspx

I am still quite sure that this is what you do as you count that is the problem, not the count action itself. What is happening during the period where you count? surely you do something else while you count right? you don't jsut go to a stats that counts without any other activity revolving around this count.

bye,

Jean