OpenHarmony开发者论坛

标题: 在OpenHarmony标准系统上用benchmark对富设备硬件进行性能测试 [打印本页]

作者: 离北况归    时间: 2023-10-17 15:29
标题: 在OpenHarmony标准系统上用benchmark对富设备硬件进行性能测试
[md]笔者昨晚在OggpenHarmony主干中[benchmark](https://gitee.com/openharmony/third_party_benchmark)基础上,移植了benchmark原生库中测试用例到OpenHarmony。主干上三方库benchmark不能合并入测试用例相关BUILD.gn代码。笔者将成果开源至如下仓库

- 开源地址:https://gitee.com/from-north-to-north/OpenHarmony_benchmark
  - 编译好的可执行文件
    - 32 位: https://gitee.com/from-north-to- ... BC%88arm32%EF%BC%89
    - 64位:https://gitee.com/from-north-to- ... BC%88arm64%EF%BC%89

## 1.benchmark介绍

Benchmark这个库是用来进行性能基准测试的。性能基准测试是一种评估计算机系统或软件性能的方法,通过运行一系列测试来测量和比较不同实现方案的性能表现。benchmark原生库仓库地址 https://github.com/google/benchmark/releases/tag/v1.6.1

## 2.移植相关代码讲解

1.具体请查看

- https://gitee.com/from-north-to- ... /benchmark/BUILD.gn
- https://gitee.com/from-north-to- ... nchmark/bundle.json

2.如何编译?

- 将此[BUILD.gn](https://gitee.com/from-north-to- ... /benchmark/BUILD.gn)合入third_party/benchmark/BUILD.gn。
- 在bundle.json中添加`"//third_party/benchmark:benchmark_tests"`,如下![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_650)
- 编译命令`./build.sh --product-name rk3568 --ccache --build-target=benchmark_tests --target-cpu arm --disable-post-build --disable-package-image --gn-args enable_notice_collection=false --gn-args skip_generate_module_list_file=true --gn-args load_test_config=false`
- 编译结果,生成如下测试用例![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_1187)
- 将测试用例推送到开发板执行,如下![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_1007)

## 3.用benchmark对DAYU200(rk3568)和Purple Pi OH(rk3566)进行性能测试

两块富设备开发板均为64位3.2R

1.进行args_product_test测试

- DAYU200![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_928)
- Purple Pi OH![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_930)

2.进行map_test测试

- DAYU200![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_658)
- Purple Pi OH![image.png](https://dl-harmonyos.51cto.com/i ... rocess=image/resize,w_820,h_693)



[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5