General performance vs graphics 1.0

I’m curious as to how people are finding the performance of their existing apps after converting to graphics 2.0.  

There are lots of great new features for us to use, such as the filters, snapshots etc, but has anyone noticed any improvements in the speed of their apps before implementing the new features (i.e. everything else is equal between your v1 and v2 app)?

I’m a bit concerned that the few apps I’ve changed have been either the same speed or slower, but I’m more than willing to admit that this could be down to me mismanaging the migration somehow. Certainly the memory usage goes down significantly, in one of my apps the texture memory goes down from 85mb to 58mb :), but at the same time the FPS goes from 45fps to 20fps :(.

Does anyone have any tips on improving the performance? Is there something that made a big difference for you that could easily be overlooked?

I need to check - but it seems that MTE has suffered a downgrade, I don’t believe I’m the first person to observe this. I haven’t performed any proper benchmark tests yet, so I’m going to boot up v1.0 and see.

Hi guys,

This is a fairly general topic, so I’m not sure what may be causing issues. One potential thing is if you’re using one of 4 or 5 complex filter effects, including “blurGaussian”. Rendering objects with those filters just once, in place, should not be an issue, but those objects are also re-rendered on every frame that they change. This includes moving those objects, via physics, transition, or enterFrame… in those cases, the GPU needs to re-render the filter on every frame refresh, and thus for complex filters like blurGaussian, the performance can suffer (and especially if you increase the parameters of those filters to more extreme levels).

Brent

Also there seemed to be some issues with anti-aliasing that impacted performance (which should be addressed in a later daily build) and something about pre-loading vs. lazy loading of images but if I’m being honest, I don’t quite understand those issues yet).

Rob

@Alan

Have you tried the latest daily build? We made several changes to how images load, changed antialiasing, as well as bug fixes.  Have you noted any performance changes on devices other than gamestick?

@Brent - As I mentioned in my first post, my apps seem to be slower before implementing any new features. No filters, no containers, just converting ref points to anchor points and changing 0-255 colours to 0-1 (and using “preloadTextures”).

@Rob Miracle -This is good to know. I wondered if there were any known issues (like the AA one) which could be affecting performance. I don’t think the preloading v lazy loading should affect gameplay once the scene is loaded though, my understanding is it only affects the initial loading of the images.

@Bryan01 - Yes we last tried it with build 2099, and that was the build I used where our FPS went down to ~20fps

I should point out that within G2 builds, I’ve noticed a slight speed up of late, although I can’t pin it down to a particular version number as I haven’t been paying attention. All I know is I can run one of my games with more onscreen without framerate hits than in the past, so that’s a good sign at least.

Have you done anything other than just the necessary migration changes (anchors, colors etc)?

As I say, we tried it with build 2099 (which was 2 builds ago), and it was noticeably slower than G1 without using any filters/snapshots etc.

Well I’m using G2-only features, so there’s no migration possible as such. I was merely commenting on how G2 seems to have sped up slightly recently, but your point is valid. I should look into updating one of my more graphics-intensive games and see how it fairs.

Time permitting, I’ll give it a stab this week and report back.

Hi, we find that the G2 switch has made our games significantly slower on all (ios) devices except the latest A7 processors. A game that was really smooth on an A5 (iphone 4s) before G2, is now totally unusable on that device. A6 works fine, just a little lag here and there. A4… well. Just forget it. Used to work fine with G1, not anymore.

@haakon  Do you have a test case or additional information you can supply?  We’ve tested a few large apps that show substantially better performance on several devices.  Are you using any third party libraries?

I need to check - but it seems that MTE has suffered a downgrade, I don’t believe I’m the first person to observe this. I haven’t performed any proper benchmark tests yet, so I’m going to boot up v1.0 and see.

Hi guys,

This is a fairly general topic, so I’m not sure what may be causing issues. One potential thing is if you’re using one of 4 or 5 complex filter effects, including “blurGaussian”. Rendering objects with those filters just once, in place, should not be an issue, but those objects are also re-rendered on every frame that they change. This includes moving those objects, via physics, transition, or enterFrame… in those cases, the GPU needs to re-render the filter on every frame refresh, and thus for complex filters like blurGaussian, the performance can suffer (and especially if you increase the parameters of those filters to more extreme levels).

Brent

Also there seemed to be some issues with anti-aliasing that impacted performance (which should be addressed in a later daily build) and something about pre-loading vs. lazy loading of images but if I’m being honest, I don’t quite understand those issues yet).

Rob

@Alan

Have you tried the latest daily build? We made several changes to how images load, changed antialiasing, as well as bug fixes.  Have you noted any performance changes on devices other than gamestick?

@Brent - As I mentioned in my first post, my apps seem to be slower before implementing any new features. No filters, no containers, just converting ref points to anchor points and changing 0-255 colours to 0-1 (and using “preloadTextures”).

@Rob Miracle -This is good to know. I wondered if there were any known issues (like the AA one) which could be affecting performance. I don’t think the preloading v lazy loading should affect gameplay once the scene is loaded though, my understanding is it only affects the initial loading of the images.

@Bryan01 - Yes we last tried it with build 2099, and that was the build I used where our FPS went down to ~20fps

I should point out that within G2 builds, I’ve noticed a slight speed up of late, although I can’t pin it down to a particular version number as I haven’t been paying attention. All I know is I can run one of my games with more onscreen without framerate hits than in the past, so that’s a good sign at least.

I am also having a lot of performance issues with Graphics 2.0.

I am using the latest build (2014.2122), and I am not using any 2.0 effects.

First of all, Storyboard is not as smooth when going from one screen to another left/right up/down. Instead of transitioning smoothly as it did with Graphics 1.0, it stutters or jumps straight to the next screen (happens on iPad1, iPad 2, iPhone 4, iPhone5).

But the main problem seem to be with the loading of images. Everything is a bit slower in iPad 1 and iPhone 4, but NOT on iPad 2 and iPhone 5 (except for Storyboard).

This is most noticeable when I use Fruit-Ninja-like code that creates a line when you touch the screen to “slice” an object:

     line=display.newImage(“images/line-effect.png”)

     line.x=v.x line.y=v.y

     line.alpha=.15;line.xScale=1.5;line.yScale=1.5;  line.blendMode=“add”

     line.rotation=math.random(0, 360)

     transition.to(line, {time = lineFadeTime, alpha = 0, xScale = 0.1, yScale = 0.1, onComplete = function(event) if line then if line.removeSelf then line:removeSelf(); line = nil;  end; end; end})        

This code basically stops my entire game if “slice” left to right with my finger quickly, several times.

Even if I comment the 3rd, 4th, 5th lines of this code, I still get the slow performance, so it is not an issue with alpha or transitions. I also tested loading JPGs with no alpha, and I still got the same issue. If I change the code to draw a circle or line instead of loading an image, then the performance is fine.

This did not happen in Graphics 1.0 (I have builds with each version installed side by side on the devices).

I am assuming the same issue is making Storyboard slower (loading a lot of images quickly, before switching to another screen). Once the screen loads, going back to the previous screen is smooth.

I hope you are aware of these issues and you are working on a fix or can suggest a workaround.

Thank you,

Jorge

FYI: Using the old Sprite Library DOES slow down performance and this is not the cause of the problem either, since I transitioned all my animations to the new Sprite engine.

Yikes, I was planning to move over to G2.0 tomorrow for a new project, but as this game only has a three week lead time I’ll stick with G1.0 as it sounds like it’s the better option at the moment.

I’m not sure if the loading time of a new texture has increased from G1.0 to G2.0, but in general (for both of them), loading textures after the scene has loaded is bound to stop the runtime while it waits for it to load. Small images load faster, while big images takes much longer, but even for small images, it’s preferable to load the texture at the start of the scene (even if you don’t use sheets, just precreate some objects with newImageRect, put them invisible and leave them be, the texture will stay loaded in memory and won’t be loaded again for other similar objects).

If you’re only loading texture at the start of the scene, apart from the initial loading time you shouldn’t see any particular slowdown during the actual game. And if it takes too much, maybe you’re using too many big images, which could use a bit of optimization.

Following these “rules”, I haven’t seen any difference in performances porting projects from 1.0 to 2.0.