简体   繁体   中英

Android Renderscript speed inconsistencies

My question is simple. I use Renderscript to blur a Bitmap .

I have on me three different Android devices to test the speed & performance of the same code. And I have witnessed some strange inconsistencies that I'd like to be explained, if possible that is.

  • 1st device : Nexus 7 2013 running stock Android 5.0, rooted with a S4 Pro 4c @1.5GHz
  • 2nd device : Samsung Galaxy Note 2 running unofficial Cyanogen Mode 13 (Android 6) with a S800, 4c @2.3GHz
  • 3rd device : Samsung Galaxy S4 Mini runnong Cyanogen Mode 13 (Android 6) with a S400 2c @1.7GHz

At first look, the fastest should be the Note 3 and the slowest ought to be the S4 Mini.

Here are the results of the process of blurring an image over and over (a 100 times ) with 25f as radius . Same blurring code is running on all devices.

  • Nexus 7 : ~10 secondes ;
  • Note 3 : ~5 secondes and
  • S4 Mini : ~3 secondes.

I might add that the image I blur is a Bitmap that streches on the whole screen. So perhaps that is the reason because there are more pixels to handle on Nexus 4 than on a Nexus 7 ? Or could it be also the version of Android ?

It's going to be a combination of a few different things:

  • Memory (RAM) speed for the SoC
  • Use of an onboard GPU or DSP vs. the CPU
  • Speed of the interface between the CPU and GPU (or DSP), if available
  • Size of the data

As you noted, the screen resolution is not the same on all devices, so the comparison isn't fair. You should make the image the same size of all 3.

The use of GPU vs. CPU is dependent on the device manufacturer (or custom ROM) having an appropriate "driver" layer at the platform level. Otherwise, Renderscript will default to using the CPU which is often not as performant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM