[英]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.
我目睹了一些我想解释的奇怪的不一致之处,如果可能的话。
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
. 这是以25f为
radius
一遍又一遍( 100次 )模糊图像的过程的结果。 Same blurring code is running on all devices. 相同的模糊代码在所有设备上运行。
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: 这将是一些不同的东西的组合:
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.