I want to detect low performance device in runtime in react native to disable complex lottie
animation. I consider for use device model from react-native-device-info
, but I should have a list of heigh performance phones
I'm also interested in this question and it would be fine to have some solution. I can think of using react-native-device-info and comparing following properties of device:
- CPU architecture (32/64 bit)
- total RAM available
- total disk capacity
- current android version
Maybe using these variables we are able to calculate some performance level with not that bad accuracy.
64bit + lets say at least 3GB RAM + 32GB capacity + one of newer Android version can be good indication that device should have some power inside.
on the other hands 32bit + 1/2GB RAM + max 8/16GB capacity + not that new Android version can lead to performance prblms.
Seriously let's talk about it :D Maybe we can find some good compromise and maybe write a lib or contribute to react-native-device-info with a feature that will try to suggest developers about device's performance.
consider use android version
we use this formula:
low android version === old phone === low performance
performance can be low if device is out of memory, too many applications opened, which browser used, etc... its hard to detect
when is neccesary, you can write small performance test in app before animations or on app load/initialization, and you can use these results.
It's possible to run any benchmark in background using web worker or use library like fireball-js, then compare the score.
© 2022 - 2024 — McMap. All rights reserved.