windows平台
- 硬件信息:
- CPU: Intel? Core? i7-9700 CPU @ 3.00GHz 3.00 GHz 8核8线程
- RAM: 32.0GB
- 编译器: VS2019: 16.10.2/msvc-14.29.30037
- 测试图片大小: 1024x1024
Debug单线程
cocos2d: Hardware ASTC decoder not present. Using software decoder
decompress astc image cost: 930.954(ms)
cocos2d: Hardware ASTC decoder not present. Using software decoder
decompress astc image cost: 926.988(ms)
cocos2d: Hardware ASTC decoder not present. Using software decoder
decompress astc image cost: 812.091(ms)
Debug 8线程并行解码
cocos2d: Hardware ASTC decoder not present. Using software decoder
decompress astc image cost: 138.524(ms)
cocos2d: Hardware ASTC decoder not present. Using software decoder
decompress astc image cost: 143.967(ms)
cocos2d: Hardware ASTC decoder not present. Using software decoder
decompress astc image cost: 132.371(ms)
Release单线程
decompress astc image cost: 33.924(ms)
decompress astc image cost: 34.163(ms)
decompress astc image cost: 30.890(ms)
Release 8线程并行解码
decompress astc image cost: 9.429(ms)
decompress astc image cost: 6.907(ms)
decompress astc image cost: 6.930(ms)
Release 8线程并行解码和png解码对比
并不说明astc快,毕竟解码astc用到了8线程,而解码png只用单线程
decompress png image (1024x1024) cost: 10.486(ms)
decompress png image (1024x1024) cost: 11.933(ms)
decompress png image (1024x1024) cost: 13.817(ms)
decompress astc image (1024x1024) cost: 11.307(ms)
decompress astc image (1024x1024) cost: 6.693(ms)
decompress astc image (1024x1024) cost: 6.566(ms)
根据测试结果,可以看出并行解密是单线程解密的3倍以上,Debug版本 6倍以上
测试代码请访问
https://github.com/adxeproject/adxe/blob/dev/cocos/base/astc.cpp
|