1

I haven't been able to find any information on this, but would it be possible/practical to do a small benchmark in a fraction of a second to roughly determine a client's JS capabilities, and then use that benchmark result to determine which "eyecandy" features of the site to enable/disable?

For instance, if the benchmark is incredibly slow, carousels and accordions could have their animations completely turned off and just cycle their content instantly instead. I don't want to just flat out restrict things based on "device" because some phones/tablets these days can run JS heavy websites flawlessly, while others can't. On top of that, I've seen some laptops that can't render basic JS tweens smoothly, so it'd be nice to determine what to run based on a benchmark instead of data about the device.

Edit:

I feel bad for posting this now, as I simply changed my keywords for a google search and managed to find two related threads on StackOverflow. They are in my answer below.

BumbleShrimp
  • 2,150
  • 23
  • 42

1 Answers1

1

I feel bad for posting this now, as I simply changed my keywords for a google search and managed to find two related threads on StackOverflow:

What's the best way to determine at runtime if a browser is too slow to gracefully handle complex JavaScript/CSS? (by Már Örlygsson)

and

Disable JavaScript function based on the user's computer's performance (by g t)

Now, while the answers in these two posts don't directly answer my question (if it's possible/practical), they point out a couple of ways to do it. I had already planned to make a small benchmark algorithm that runs for approximately 100ms, and then just count the iterations it manages to complete; however, these two threads confirm my theory of that method working. So I guess there's no longer anything to be answered here.

Community
  • 1
  • 1
BumbleShrimp
  • 2,150
  • 23
  • 42