AlbertTJames

Rendering performance 2D "Game"

Recommended Posts

Hey everyone,

 

I have a very simple 2D "minigame" that looks like this (please don't mind the uglyness) :

58b97146a2be5_ScreenShot2017-03-03at14_23_08.png.6b294a1aebed2a62006bb9b990c93572.png

So very simple, only one sprite and a couple of shapes. But my computer (macbook pro) often starts heating up while running the task. So I ran a memory audit (around 700ko increase per minute, that are due to me storing a lot of stuff) and also ran a CPU profile with devtools. Here are the results of the CPU profile:

58b9720dadff7_ScreenShot2017-03-03at14_22_58.png.25cdc5b37223dd9b5694ece1c6003bcd.png

 

I was wondering if those results seemed ok to you ? @Nockawa 

Or do you think I might be doing something wrong in the code? (too large to share)

When I look at the engine.fps I am at around 60fps, so perfect on that side.

The game will be used by around 300 people all over the US with all sort of computers, mine is a high end macbook pro of last year (with of course a shity gpu but still pretty common for macs):

2.2Ghz i7 - 16Gb ddr3 - Intel iris pro 1536 mb - Mac/OS sierra using Chrome Canari

 

Thanks !

Share this post


Link to post
Share on other sites

Well, I'm not really concerned, the number are really low, now if you don't do anything special in 3D it's understandable that most of the time is in C2D.

I've just noticed that I don't display the render time in ms in the Canvas Profile, I'm going to add it.

MasterK did waaaaaaaay much more complicated in his game, so I'm pretty confident, but be assured, I wouldn't let a perf issue aside. Perf is top priority.

Let's keep this thread for a while, I'm about to release a new version I'm going to add the counter and also profile it thoroughly before releasing it, I'll keep you in touch.

I've created this Trello Card for me to remind about it.

Take a look at MasterK's game here: https://apps.facebook.com/locotitans/ all the UI is made with Canvas2D you'll see there's plenty of it.

Share this post


Link to post
Share on other sites

That chrome profile is showing that the CPU is almost entirely idle. I wouldn't worry too much about the mac book heating up - in my experience they heat up pretty much any time the GPU is running, even for trivial amounts of work. Just how they're made, I think - partly caused by the fact that Apple doesn't like fan noises, so the fans stay off until the machine gets really hot.

Share this post


Link to post
Share on other sites

I dont worry about c2d's frame time. it's stable and acceptable.

I'm worry about the memory leak...

In our game, play core battle scene 6-8 times will rise memory to 1G....

And I think BJS dont make good manager with mesh/geom/vertice/buff or other these things.

when i dispose all meshes, textures, materials...(almost like scene.dispose) some BJS object hasn't clean memory. @Deltakosh

 

Share this post


Link to post
Share on other sites

You have to pay attention to all reference to your meshes, otherwise it won't be taken into account by the garbage collector. It's not related to bjs in any way. I use bjs in several professional apps, and the only problem I had with the memory management was related to my work on storing meshes and materials.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.