iOS 15 performance drop

Hello,

I am working on a game for iOS using Phaser 3 and Cordova.
Back in iOS 14, I had 50-60 fps on an iPhone XR and iPad mini 5. But since I updated both to iOS 15, performance has dropped to around 10 fps on both, without changing the code.
Anyone have any ideas… or have observed the same behavior?

Phaser: 3.55.2
iOS: 15.0.1
Cordova-ios: 6.2.0

(Around 3000 GameObjects)
(Using the WKWebView and WebGL)

Bug 230749: REGRESSION (Safari 15): Poor WebGL performance on https://downloads.scirra.com/labs/particles

1 Like

Thanks a lot! I had suspected that it might be such a problem. Glad to see it’s known and being worked on. Cool to see that @rich is aware of it as well. Hopefully it will be fixed soon.

Do we know anything about this? We are still seeing massive frame drops in iOS 15+

As far as I know, there hasn’t been much progress on that front. Apple is of course struggling with its webgl bugs that cause these problems, and they are very tricky from what I’ve read.
@rich is working on them and fixing as many as possible for the release of Phaser 3.60, but beta 3 of 3.60 causes even worse performance of 1-2 FPS on my game and beta 4 doesn’t work at all. The screen is just black without any errors.

There is one hope I found in the Phaser Discord which partly worked for me: If I downgrade to Phaser 3.24, I regain most of the original FPS in iOS 15. The game runs at 40-50 FPS on the iPhone Xr. Maybe @rich knows why this is the case?

Update: I read in the change log of version 3.50, which followed 3.24:
“WebGL Pipelines are responsible for the rendering of all Game Objects in Phaser and they have had a complete rewrite in 3.50. This was to allow for the introduction of post processing pipelines, now readily available to be created from the new Post FX Pipeline class. The changes in this area have been extensive, so if you use custom WebGL Pipelines in your game already, you must update your code to use Phaser 3.50.”.
So this is probably the cause of the performance differences.

Wish Apple would ship the fix… I’ve been battling this issue for a while now and it is frustrating to have our game get 60fps on older android devices, but the current generation iOS devices are just unplayable pretty much… well maybe not unplayable, but it’s unacceptable.

Hopefully, this weekend’s experiment of reverting phaser to 3.24.1 and figuring out solutions to what I’m lacking from 3.50+ goes well. Postfx/ stuff and compressed texture support are the two that stick out so far, so I guess today’s task will be writing a custom load handler for compressed textures.

Would love to know if anybody else has had any success with any of this?

He

we found a fix for this

phaser 3.52

The key is batchSize - you need to set batchSize in game config to 512 or less
we have games that run at 3FPS without this change and smooth 60FPS with this

also antialiasGL can make large difference, so setting this to false mau help a bit. But the real deal is the batchSize

2 Likes

Thanks for the reply @pavels. We use pixelArt: true, so the antialiasGL was already set to false, and my initial testing with changing batchSize does not seem to help.

With that said, I did spend the weekend putting throwing together a plugin that ports the compressed texture support from 3.60 to 3.24.1 (possibly other versions too, but I haven’t taken the time to test on any of them). Running 3.24.1 with compressed textures our game is back to 60fps, so now it’s just a matter of porting over some of the other functionality from 3.50 and 3.60 that we need. Would have been nice if the batchSize config change would have produced the same results it did for you. Let me know if there is anything else you can think might have help you with the issue =)

Cheers!
Fielding

P.S. If anybody else comes across this and has a need for compressed texture support in 3.24.1, this did the trick for me: GitHub - fielding/phaser-compresed-textures-plugin: Compressed texture plugin for phaser 3.24.1

1 Like

Thank you for taking the time to put this on github. I have an important question: is compressed texture supported by every mobile device?

Thanks for the contribution @pavels. The combination of version 3.24.1 and the batchSize 512/antialiasGL false has restored all FPS (60) in my application.

great question! unfortunately, I don’t know the exact answer, but I do know that some form of compressed textures are supported on 99% of android devices (will include various references from my notes, including the one I got that percentage from below). I’m not 100% sure about iOS devices, but it seems that, again, some version of compressed textures are supported all the way back to iPhone 5S.

So it seems it really comes down to which format. Luckily for us, Phaser will gracefully fall back to a supported version (or non-compressed textures) if we provide a range of formats and the proper configuration. See the comment here: phaser/CompressedTextureFile.js at aa5f54cfa268c86823bf1dd52c83099fa0ef9ac2 · photonstorm/phaser · GitHub

I’m personally only using ASTC for now and plan to revisit and optimize the compressed texture offerings/config when it gets to that point. Using ASTC made a huge difference on the latest iOS devices for my project since it uses large textures and mobile memory is limited.

Something like DXT/S3TC for desktop, ASTC pref. for mobile, PVRTC and ETC for mobile devices that didn’t support ASTC, and finally fallback to browser native formats for devices that support no compressed textures is probably an alright way to go about it.

Here are some various references:

2 Likes

If you’re running 3.24.1 you dont need batchSize/analiasGL, the performance drop is on 3.50 and above

1 Like

Wow thank you for this great answer :ok_hand:

@thenonamezz

(Before iOS 15 I had 60 fps with every phaser version, after iOS 15 with 3.50+ terrible performance. When I switched to 3.24.1 I had 40 fps again and strangely after using the batchSize/antialiseGL fix with 3.50+ I dropped to 20-30 fps… after testing 3.24.1 together with the batchSize/antialiseGL fix, I finally had 60 fps again. :thinking:)

Maybe it’s because of antialiseGL that I got the rest of the FPS back with 3.24.1.

Update: Without code change, fps dropped again to about 40 (3.24.1) @thenonamezz is right, batchSize/antialiseGL doesn’t affect 3.24.1.

What happens if you go back to 3.23.0? That’s the we use for our project currently

I played around with the settings and somehow got 55-60 fps again with 3.24.1. I also tested 3.23.0 with the same result. So it works now I suppose.
What I don’t understand is that even when the fps sometimes fall to 30/40, the CPU usage stays at 3% the hole time. (iPhone XR)

There are some WebGL fixes in Safari 15.5 Beta.

1 Like

After speaking with CodeCycle on how he improved the performance, I did it for my game which had the FPS issues since iOS 15, and using Phaser 3.5+, now it works way better.

Tested on iOS 15.4.

The changes are in the game config:

https://newdocs.phaser.io/docs/3.52.0/Phaser.Core.Config

render: {
            antialiasGL: false,

            batchSize: 512
}

It may a be a clue for some of you :slight_smile:

Thanks @CodeCycle !!

1 Like

Great to hear :ok_hand: You have to thank @pavels for originally finding this fix.