1

Maybe it is possible by indirectly looking for it, maybe something like looking for window.WebAssembly && window.Worker maybe but I'm not really sure what works. It should be a very generic and stable solution.

In addition to Using javascript to detect device CPU/GPU performance?, it should be a very simple test without having to do any WebGL or similar tests.


The css animation I use has the following keyframes:

 animation: bgRotation 240s linear infinite; @keyframes bgRotation { from { background-position: 0 0; } 50% { background-position: -4000px 0; } to { background-position: 0 0; } } 
3
  • 1
    So I know you're asking about detecting CPU/GPU performance - but I suppose ideally you would prefer that the animation was just smooth in all cases? How are you animating the rotation? This seems related/duplicate, using navigator.hardwareConcurrency: stackoverflow.com/questions/39516931/… Commented Dec 26, 2023 at 14:35
  • @Jeppe I have a css animation where the background position changes of a fullscreen hd image. Well, navigator.hardwareConcurrency seems to be a good starting point. But what if there are multiple cpu but slower ones? And what about gpu? Isn't this even more important for such animations? On a Redmi 12 for example, it is slow, even though there are 8 cpu in total: mi.com/global/product/redmi-12/specs Commented Dec 26, 2023 at 17:35
  • You can also explore the Performance API (developer.mozilla.org/en-US/docs/Web/API/Performance_API) Commented Dec 26, 2023 at 21:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.