Jump to content
Search Community

Performance measurement

Lynesth 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

I'm making a website that has some animations.

 

I thought everything was perfect until I tried accessing the website with a computer that doesn't have a dedicated CG/GPU.

I then realized that:

1) The animations were pretty laggy

2) It was using a very big amount of CPU to run those

 

Then I thought to myself that I'd make a "low performance version" of the animations and use them if the browser/computer isn't good enough.

 

I'm currently checking this by retrieving the WebGL renderer used by the browser and setting the low perfs version if it doesn't contain "NVIDIA/ATI/AMD" in its name.

 

Would you guys do it some other way ? I tried the failIfMajorPerformanceCaveat thing from canvas context but it didn't help.

 

Is there an easy way to get the FPS count of an animation or some performance indicators that could allow me to achieve this ?

 

 

Link to comment
Share on other sites

There isn't a built-in way to do that sort of thing, no. But you can check the TweenLite.ticker.frame and TweenLite.ticker.time to figure out the FPS, but be careful about doing that too early because every site has a huge influx of CPU activity initially (when loading/rendering the page). Like TweenLite.ticker.frame / TweenLite.ticker.time. 

 

Just beware that the FPS is also dependent on the screen refresh rate on the actual device. So, for example, if someone's screen is running at 30hz, you're not gonna get 60FPS no matter what - it'll be closer to 30fps even if the CPU is under almost zero load. So don't just assume that 30fps is "bad" or laggy or something. 

 

Does that help? 

  • Like 2
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...