# 在OpenHarmony标准系统上对富设备硬件进行benchmark测试 **Repository Path**: bingnvnice/OpenHarmony_benchmark ## Basic Information - **Project Name**: 在OpenHarmony标准系统上对富设备硬件进行benchmark测试 - **Description**: 在OpenHarmony主干上benchmark的基础上,将benchmark原生库中测试用例移植到OpenHarmony上。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-12-25 - **Last Updated**: 2023-12-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 在OpenHarmony标准系统上对富设备硬件进行benchmark测试 - 文件说明 - 移植好的测试用例BUILD.gn构建脚本的benchmark(1.6.1版本) - 编译好的可执行的benchmark测试用例(arm32) - 编译好的可执行的benchmark测试用例(arm64) - 问题咨询与解答 - 请前往笔者[博客主页](https://ost.51cto.com/person/posts/15277389 )介绍处获取联系方式 ## 1.benchmark介绍 Benchmark这个库是用来进行性能基准测试的。性能基准测试是一种评估计算机系统或软件性能的方法,通过运行一系列测试来测量和比较不同实现方案的性能表现。benchmark原生库仓库地址 https://github.com/google/benchmark/releases/tag/v1.6.1 ## 2.移植相关代码讲解 1.具体请查看 - https://gitee.com/from-north-to-north/OpenHarmony_benchmark/blob/master/%E7%A7%BB%E6%A4%8D%E5%A5%BD%E7%9A%84%E6%B5%8B%E8%AF%95%E7%94%A8%E4%BE%8BBUILD.gn%E6%9E%84%E5%BB%BA%E8%84%9A%E6%9C%AC%E7%9A%84benchmark%EF%BC%881.6.1%E7%89%88%E6%9C%AC%EF%BC%89/benchmark/BUILD.gn - https://gitee.com/from-north-to-north/OpenHarmony_benchmark/blob/master/%E7%A7%BB%E6%A4%8D%E5%A5%BD%E7%9A%84%E6%B5%8B%E8%AF%95%E7%94%A8%E4%BE%8BBUILD.gn%E6%9E%84%E5%BB%BA%E8%84%9A%E6%9C%AC%E7%9A%84benchmark%EF%BC%881.6.1%E7%89%88%E6%9C%AC%EF%BC%89/benchmark/bundle.json 2.如何编译? - 将此[BUILD.gn](https://gitee.com/from-north-to-north/OpenHarmony_benchmark/blob/master/%E7%A7%BB%E6%A4%8D%E5%A5%BD%E7%9A%84%E6%B5%8B%E8%AF%95%E7%94%A8%E4%BE%8BBUILD.gn%E6%9E%84%E5%BB%BA%E8%84%9A%E6%9C%AC%E7%9A%84benchmark%EF%BC%881.6.1%E7%89%88%E6%9C%AC%EF%BC%89/benchmark/BUILD.gn)合入third_party/benchmark/BUILD.gn。 - 在bundle.json中添加`"//third_party/benchmark:benchmark_tests"`,如下![image.png](https://dl-harmonyos.51cto.com/images/202308/7479316015d76f2a89e3521d1bbed36d944f2d.png?x-oss-process=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/images/202308/a40a6da60abf75e3c12917f77d31c89881d85e.png?x-oss-process=image/resize,w_820,h_1187) - 将测试用例推送到开发板执行,如下![image.png](https://dl-harmonyos.51cto.com/images/202308/88c940101fcff684e1c45901a9896b4c3c8a2e.png?x-oss-process=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/images/202308/68bc7af7543bc01823b635c75f30ca4d2ec470.png?x-oss-process=image/resize,w_820,h_928) - Purple Pi OH![image.png](https://dl-harmonyos.51cto.com/images/202308/28d3b4839a60c5a7df393572f6e8e06e5efae9.png?x-oss-process=image/resize,w_820,h_930) 2.进行map_test测试 - DAYU200![image.png](https://dl-harmonyos.51cto.com/images/202308/35c7cc7713e4f6130dc724aa3fac9c2cbfc9db.png?x-oss-process=image/resize,w_820,h_658) - Purple Pi OH![image.png](https://dl-harmonyos.51cto.com/images/202308/87ed4cf38d102f840dc171f5282d42e740b72c.png?x-oss-process=image/resize,w_820,h_693)