Jump to content
Search Community

Banners taking all CPU from games site

GameSite test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Ok I have just sent you the game URL in private msg,  

 please test with Firefox, its easiest browser to reproduce this issue.

 

Please notice problem occurs even with one tween banner ad ,

 but sometimes there are two tween banners at screen at same time.

Link to comment
Share on other sites

Interesting issue. What are you using to display the ads? Are you using AdSense or DFP? Or some other service?

 

I agree with @dev-kp that this really shouldn't be happening at all.

 

Normally the ads will get vetted for high CPU usage.

 

One solution would be to restrict HTML5/JavaScript Ads on game pages to only JPG/GIF but allow them on other navigational pages.

 

Link to comment
Share on other sites

13 minutes ago, GameSite said:

I think you should fix the issue in your code library somehow?

 

I'm confused - do you think GSAP (TweenLite) is somehow to blame for the problem? If so, can you help me understand the evidence you're looking at? That call stack you shared seemed to indicate that there's some function called drawTextPlate() that's the cause of the problems (and that has nothing to do with our library).

 

GSAP is pretty well-known as being the most performant, robust animation library available which is why every major ad network has whitelisted it. I'm pretty sure that if GSAP caused major problems performance-wise, it wouldn't be so ubiquitous in the ad industry (or elsewhere). But of course if there is some problem you stumbled upon that's a true bug in GSAP, we certainly want to fix it - I'd just need to see some evidence and a reduced test case so that I can effectively troubleshoot. 

 

But again, it sure sounds like the problem is in that drawTextPlate() function that someone else wrote and is unrelated to GSAP. 

Link to comment
Share on other sites

It's difficult to know exactly what your issue is without having any URLs to check and see what is happening.

 

I understand that you might not want to block ads and lose revenue, but you need to understand that if you're allowing ads from all kinds of places, the ads could be running all sorts of code on your website without your permission. Online advertising gets a bad rep from things like this, and it takes the community to be diligent to ensure bad actors don't flood the internet with malicious ads. (These ads might not be intentionally malicious, but just poorly coded. Or simply too heavy to be run on your website.)

 

I've used GSAP in the creation of several thousand ads with varying degrees of complexity, it would have been rare that any of my builds had any effect on a website's performance, and if that did happen, the bugs were most likely code that I created as opposed to code created by @GreenSock

  • Like 2
Link to comment
Share on other sites

Also, you could consider setting GSAP to run at a lower FPS, though that'd affect all GSAP animations on the page:

 

TweenLite.ticker.fps(15); //won't go over 15 frames per second

 

But of course that means they wouldn't play as smoothly which might be annoying for whoever paid to place that add, and it might annoy users a bit too but they're probably more interested in your game performing well :)

Link to comment
Share on other sites

13 hours ago, OSUblake said:

 

Tank ads? Running multiple WebGL contexts could be the problem. That's assuming Phaser is also using WebGL.

 

The web page has actually two  "Tank Ads"  appearing there at same time, one is vertical and one is horizontal,

 and all games having the slowness problem are done with  Phaser yes.

 

Sorry to bother you here, I don't want to be rude or anything I think your GreenSock as excellent,

but its good to have the workaround code to priorize  the primary content of page and slow down the ads;



I just tried to give this command TweenLite.ticker.fps(15);   to firefox javascript Console, but got error

TweenLite is not defined, but I can see it on performance tab.

 

 

 TweenLite.ticker.fps(15);
Link to comment
Share on other sites

16 hours ago, GreenSock said:

 

I'm confused - do you think GSAP (TweenLite) is somehow to blame for the problem? If so, can you help me understand the evidence you're looking at? That call stack you shared seemed to indicate that there's some function called drawTextPlate() that's the cause of the problems (and that has nothing to do with our library).

 

GSAP is pretty well-known as being the most performant, robust animation library available which is why every major ad network has whitelisted it. I'm pretty sure that if GSAP caused major problems performance-wise, it wouldn't be so ubiquitous in the ad industry (or elsewhere). But of course if there is some problem you stumbled upon that's a true bug in GSAP, we certainly want to fix it - I'd just need to see some evidence and a reduced test case so that I can effectively troubleshoot. 

 

But again, it sure sounds like the problem is in that drawTextPlate() function that someone else wrote and is unrelated to GSAP. 

 

Sorry, I only saw this TweenLite brand inside my Firefox stack trace, always when my games have trouble, so I wrote here for help,  I don't want to blame you.     Maybe you could  detect somehow two TweenLite ads  running at same time, and do something for CPU use,  or is it best solution for 3rd party website owners to give a command like  TweenLite.ticker.fps(15);

 

 

I will try to add here a more detailed stack from firefox soon

 

 

Link to comment
Share on other sites

15 hours ago, OSUblake said:

 

Tank ads? Running multiple WebGL contexts could be the problem. That's assuming Phaser is also using WebGL.

Hello guys!

Yes this is our ad. Exactly this banner does not use any WebGL content. We checked it from our side and didn't noticed any extreme CPU usage. Yes it is a bit high but on average computer goes without any problems, slowdowns etc. 

 

The only solution I can propose is to assign somehow the priority for rendering different parts of the site. High - for game, low - for ad block. But not sure if this possible.

  • Like 1
Link to comment
Share on other sites

 

Thanks for checking this out,  did you use Firefox for testing?  

  I think your banners are reading also keyboard events,  could that be reason for slowness as game is also keyboard controlled...

 

I just tested a little again and our  games work a lot faster with  other 3rd party animated ads such as WarThunder and OverWatch animated banners, also HBO video ads are ok.  I am not sure if priority rendering is possible

 

I would not like to blacklist any banners,  but of course usability for the game site itself is priority for us.

 

 

6 minutes ago, volcanoflash said:

Hello guys!

Yes this is our ad. Exactly this banner does not use any WebGL content. We checked it from our side and didn't noticed any extreme CPU usage. Yes it is a bit high but on average computer goes without any problems, slowdowns etc. 

 

The only solution I can propose is to assign somehow the priority for rendering different parts of the site. High - for game, low - for ad block. But not sure if this possible.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...