Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increases temperature on ios devices #134

Open
RollinSafary opened this issue Nov 5, 2019 · 2 comments
Open

Increases temperature on ios devices #134

RollinSafary opened this issue Nov 5, 2019 · 2 comments

Comments

@RollinSafary
Copy link

Hi, i'm developing a game that is using socketcluster for connection to server. So ios devices are getting hot very quickly because of this. After turning off socket connections module in my game temperature become normal. So please check why is this happening and is there any way to fix it?

@jondubois
Copy link
Member

jondubois commented Nov 5, 2019

@RollinSafary What is the rate of messages on your client socket? If your client is sending and/or receiving a large number of messages per second and doing a lot of processing, then it can use up CPU which I guess could cause heating. I haven't heard about such issue before so I suspect it may be specific to your use case.

Note though that even highly optimized games like agar.io cause my laptop to overheat because they have a very high message rate.

@RollinSafary
Copy link
Author

The main situation is following:
I'm using cordova platform ios to build game for ios platform. Used game engine is Phaser 3, for socket connection is used socket-cluster.
Problem is that my app energy usage is in the end of energy usage "Very High" section. It means that with this usage increasing temperature is normal.
So I've done some tests to find out what does the most part of energy usage.
First test was running empty cordova project without any rendering and network connection. Result was near to no energy usage. So conclusion was that it's not cordova wrapper issue.
Second test: I've tried to run my game without socket connection. Opened one scene and made there multiple animations with hard calculations (but I haven't any scene in with such a load) in 60 fps rendering. So the energy usage was on the start of "Medium" section. Conclusion is that it's not rendering or calculations load.
Third test: I've run my game and still on menu scene. Which is static scene (without any animations). Energy usage was light.
Socket test below
The last test was just usage of socket cluster only for subscribing without getting and sending events.
Game scene is static view without any animations or actions.
So my socket client was sending just ping (every 3 secs) to server. But the energy usage was in the middle of "Very High" section. After entering to game play scene (i'm getting and sending 1 message in 6 second) I've energy usage in the end of "Very High" section.

The most strange part for me is, that even for old android devices socket cluster doesn't make so much energy usage. Tested device was nexus 4 and nexus 5.

The main conclusion is that something wrong in workflow of socket cluster for safari. Because on chrome webView it works just fine.
P.S. I've even deployed game on website and have opened it from safari browser and iPhone starts burning after minute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants