简体   繁体   English

Android Renderscript速度不一致

[英]Android Renderscript speed inconsistencies

My question is simple. 我的问题很简单。 I use Renderscript to blur a Bitmap . 我使用Renderscript 模糊 Bitmap

I have on me three different Android devices to test the speed & performance of the same code. 我在三个不同的Android设备上测试相同代码的速度和性能。 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 第一个设备:运行有Android 5.0的Nexus 7 2013,植根于S4 Pro 4c @ 1.5GHz
  • 2nd device : Samsung Galaxy Note 2 running unofficial Cyanogen Mode 13 (Android 6) with a S800, 4c @2.3GHz 第二台设备:运行非官方的Cyanogen模式13(Android 6)的Samsung Galaxy Note 2,带有S800、4c @ 2.3GHz
  • 3rd device : Samsung Galaxy S4 Mini runnong Cyanogen Mode 13 (Android 6) with a S400 2c @1.7GHz 第三台设备:具有S400 2c @ 1.7GHz的Samsung Galaxy S4 Mini runnong Cyanogen模式13(Android 6)

At first look, the fastest should be the Note 3 and the slowest ought to be the S4 Mini. 乍一看,最快的应该是Note 3,最慢的应该是S4 Mini。

Here are the results of the process of blurring an image over and over (a 100 times ) with 25f as radius . 这是以25fradius一遍又一遍( 100次 )模糊图像的过程的结果。 Same blurring code is running on all devices. 相同的模糊代码在所有设备上运行。

  • Nexus 7 : ~10 secondes ; Nexus 7:〜10秒;
  • Note 3 : ~5 secondes and 注3:〜5秒和
  • S4 Mini : ~3 secondes. S4 Mini:〜3秒。

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 ? 也许这就是原因,因为Nexus 4的像素要比Nexus 7多得多? Or could it be also the version of Android ? 还是Android的版本?

It's going to be a combination of a few different things: 这将是一些不同的东西的组合:

  • Memory (RAM) speed for the SoC SoC的内存(RAM)速度
  • Use of an onboard GPU or DSP vs. the CPU 使用板载GPU或DSP与CPU
  • Speed of the interface between the CPU and GPU (or DSP), if available CPU和GPU(或DSP)之间的接口速度(如果有)
  • 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. 您应将图片的大小设为所有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. GPU与CPU的使用取决于设备制造商(或定制ROM)在平台级别具有适当的“驱动程序”层。 Otherwise, Renderscript will default to using the CPU which is often not as performant. 否则,Renderscript将默认使用通常性能不佳的CPU。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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