Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 17-Mar-2025 | - | ||||
ashemem_benchmark_test/ | H | 17-Mar-2025 | - | 539 | 354 | |
datatime_benchmark_test/ | H | 17-Mar-2025 | - | 248 | 179 | |
directory_benchmark_test/ | H | 17-Mar-2025 | - | 592 | 414 | |
event_benchmark_test/ | H | 17-Mar-2025 | - | 1,480 | 1,080 | |
file_benchmark_test/ | H | 17-Mar-2025 | - | 1,029 | 766 | |
mapped_benchmark_test/ | H | 17-Mar-2025 | - | 1,844 | 1,186 | |
observer_benchmark_test/ | H | 17-Mar-2025 | - | 231 | 185 | |
parcel_benchmark_test/ | H | 17-Mar-2025 | - | 2,588 | 1,919 | |
refbase_benchmark_test/ | H | 17-Mar-2025 | - | 1,932 | 1,478 | |
rwlock_benchmark_test/ | H | 17-Mar-2025 | - | 273 | 180 | |
safe_block_queue_benchmark_test/ | H | 17-Mar-2025 | - | 695 | 574 | |
safe_block_queue_tracking_benchmark_test/ | H | 17-Mar-2025 | - | 703 | 585 | |
safe_map_benchmark_test/ | H | 17-Mar-2025 | - | 654 | 487 | |
safe_queue_benchmark_test/ | H | 17-Mar-2025 | - | 478 | 352 | |
singleton_benchmark_test/ | H | 17-Mar-2025 | - | 262 | 209 | |
sorted_vector_benchmark_test/ | H | 17-Mar-2025 | - | 859 | 720 | |
string_benchmark_test/ | H | 17-Mar-2025 | - | 800 | 583 | |
thread_benchmark_test/ | H | 17-Mar-2025 | - | 526 | 384 | |
thread_pool_benchmark_test/ | H | 17-Mar-2025 | - | 442 | 361 | |
timer_benchmark_test/ | H | 17-Mar-2025 | - | 444 | 345 | |
unique_fd_benchmark_test/ | H | 17-Mar-2025 | - | 332 | 277 | |
BUILD.gn | H A D | 17-Mar-2025 | 1.6 KiB | 42 | 40 | |
README.md | H A D | 17-Mar-2025 | 4.4 KiB | 106 | 88 | |
README_zh.md | H A D | 17-Mar-2025 | 4.6 KiB | 106 | 87 | |
benchmark_assert.h | H A D | 17-Mar-2025 | 2.5 KiB | 91 | 66 | |
benchmark_log.h | H A D | 17-Mar-2025 | 1.5 KiB | 37 | 17 |
README.md
1# Benchmark Test 2 3Benchmarking is an activity of measuring and evaluating software performance indicators, which can establish a known 4performance level (called a baseline) at a certain time through benchmarking. 5When the software and hardware environment of the system changes, another benchmarking is conducted to determine the 6impact of those changes on performance. This is the most common use of benchmark testing, with other uses including 7determining performance limits at certain load levels, managing changes in systems or environments, 8and identifying conditions that may cause performance issues. 9 10## 目录结构 11 12``` 13commonlibrary/c_utils/base/test 14├─ benchmarktest 15│ ├── ashemem_benchmark_test # Anonymous Shared Memory API test 16│ ├── datetime_benchmark_test # datetime API test 17│ ├── directory_benchmark_test # directory API test 18│ ├── event_benchmark_test # event API test 19│ ├── file_benchmark_test # file API test 20│ ├── mapped_benchmark_test # mapped API test 21│ ├── observer_benchmark_test # observer API test 22│ ├── parcel_benchmark_test # parcel API test 23│ ├── refbase_benchmark_test # refbase API test 24│ ├── rwlock_benchmark_test # rwlock API test 25│ ├── safe_block_queue_benchmark_test # safe blocke queue API test 26│ ├── safe_block_queue_tracking_benchmark_test 27│ ├── safe_map_benchmark_test # safe map API test 28│ ├── safe_queue_benchmark_test # safe queue API test 29│ ├── singleton_benchmark_test # singleton API test 30│ ├── sorted_vector_benchmark_test # sortedvector API test 31│ ├── string_benchmark_test # string API test 32│ ├── thread_benchmark_test # thread API test 33│ ├── thread_pool_benchmark_test # threadpool API test 34│ ├── timer_benchmark_test # timer API test 35│ ├── unique_fd_benchmark_test # uniquefd API test 36│ ├── benchmark_assert.h 37│ ├── BUILD.gn 38│ └── benchmark_log.h 39``` 40 41## Build 42### Build Component 43``` 44./build.sh --product-name rk3568 --build-target c_utils 45``` 46 47### Build testsuits 48``` 49./build.sh --product-name rk3568 --build-target commonlibrary/c_utils/base/test/benchmarktest/ 50``` 51 52### output 53``` 54/out/rk3568/tests/benchmark 55``` 56 57## Test environment setup(windows) 58### Test dir 59 60``` 61 62Test 63├── developer_test # test framework(git clone https://gitee.com/openharmony/testfwk_developer_test.git) 64│ ├── aw 65│ ├── config 66│ │ ├── framework_config.xml #config the benchmark timeout field to "900" 67│ │ └── user_config.xml # The SN field needs to be configured with the development board serial numbe 68 test_cases field needs to be configured with the compiled test case directory 69│ ├── examples 70│ ├── src 71│ ├── third_party 72│ ├── reports #test result 73│ ├── BUILD.gn 74│ ├── start.bat # Windwos 75│ └── start.sh # Linux 76├── testcase # cp -r /out/rk3568/tests/benchmark/ XXX/testcase/ 77└── xdevice # (git clone https://gitee.com/openharmony/testfwk_xdevice.git) 78 79``` 80## Execute test cases(windows) 81### start test framework 82 start.bat 83 84### Select product type 85 default : rk3568 86 87 88### Execute(eg:parcel) 89 eg:run -t BENCHMARK -ts ParcelTest 90 91 Instructions for executing command parameters: 92 ``` 93 -t [TESTTYPE]: Specify test case type,such as UT,MST,ST,PERF,FUZZ,BENCHMARK。(Required parameters) 94 -ts [TESTSUITE]: Specify test suilts,can be used independently。 95 ``` 96 97### Test report log 98After executing the test instructions, the console will automatically generate test results. 99If you need a detailed test report, you can search in the corresponding data document. 100 101#### Test results 102The root path of the test result output is as follows: 103``` 104Test/developer_test/reports/xxxx_xx_xx_xx_xx_xx 105 106
README_zh.md
1# Benchmark测试 2 3基准测试(benchmarking)是一种测量和评估软件性能指标的活动,可以在某个时候通过基准测试建立一个已知的性能水平(称为基准线), 4当系统的软硬件环境发生变化之后再进行一次基准测试以确定那些变化对性能的影响。这是基准测试最常见的用途,其他用途包括测定某种负载水平下的性能极限、 5管理系统或环境的变化、发现可能导致性能问题的条件等。 6 7## 目录结构 8 9``` 10commonlibrary/c_utils/base/test 11├─ benchmarktest 12│ ├── ashemem_benchmark_test # 匿名共享内存接口性能测试 13│ ├── datetime_benchmark_test # 日期与时间接口性能测试 14│ ├── directory_benchmark_test # 文件与目录接口性能测试 15│ ├── event_benchmark_test # 事件处理系统接口性能测试 16│ ├── file_benchmark_test # 读写文件接口性能测试 17│ ├── mapped_benchmark_test # 文件映射接口性能测试 18│ ├── observer_benchmark_test # 观察者模式接口性能测试 19│ ├── parcel_benchmark_test # 使用Parcel作为数据容器接口性能测试 20│ ├── refbase_benchmark_test # 智能指针管理动态分配内存对象接口性能测试 21│ ├── rwlock_benchmark_test # 读写锁接口性能测试 22│ ├── safe_block_queue_benchmark_test # 线程安全阻塞队列接口性能测试 23│ ├── safe_block_queue_tracking_benchmark_test 24│ ├── safe_map_benchmark_test # 线程安全Map接口性能测试 25│ ├── safe_queue_benchmark_test # 线程安全栈与队列接口性能测试 26│ ├── singleton_benchmark_test # 单例模式接口性能测试 27│ ├── sorted_vector_benchmark_test # 有序Vector接口性能测试 28│ ├── string_benchmark_test # 字符串处理接口性能测试 29│ ├── thread_benchmark_test # 强化线程能力接口性能测试 30│ ├── thread_pool_benchmark_test # 线程池接口性能测试 31│ ├── timer_benchmark_test # 定时器接口性能测试 32│ ├── unique_fd_benchmark_test # 管理、传递文件描述符接口性能测试 33│ ├── benchmark_assert.h 34│ ├── BUILD.gn 35│ └── benchmark_log.h 36``` 37 38## 编译构建 39### 编译部件 40``` 41./build.sh --product-name rk3568 --build-target c_utils 42``` 43 44### 测试套编译 45``` 46./build.sh --product-name rk3568 --build-target commonlibrary/c_utils/base/test/benchmarktest/ 47``` 48 49### 测试套生成路径 50``` 51/out/rk3568/tests/benchmark 52``` 53 54### 编译静态库 55``` 56./build.sh --product-name rk3568 --build-target commonlibrary/c_utils/base:utilsbase 57``` 58 59## 测试环境构建(windows) 60### 测试目录构建 61 62``` 63 64Test 65├── developer_test # 开发者自测试框架 git clone https://gitee.com/openharmony/testfwk_developer_test.git 66│ ├── aw 67│ ├── config # 测试框架配置 68│ │ ├── framework_config.xml #配置benchmark timeout字段为"900" 69│ │ └── user_config.xml #sn字段需要配置开发板序列号 test_cases字段需要配置编译生成的测试用例目录 70│ ├── examples 71│ ├── src 72│ ├── third_party 73│ ├── reports # 测试结果报告 74│ ├── BUILD.gn 75│ ├── start.bat # Windows 76│ └── start.sh # Linux 77├── testcase # cp -r /out/rk3568/tests/benchmark/ XXX/testcase/ 78└── xdevice # git clone https://gitee.com/openharmony/testfwk_xdevice.git 79 80``` 81## 执行测试用例(windows) 82### 启动测试框架 83 执行start.bat 84 85### 选择产品形态 86 默认选择为rk3568 87 88 89### 执行测试用例(以parcel为例) 90 eg:run -t BENCHMARK -ts ParcelTest 91 92 执行命令参数说明: 93 ``` 94 -t [TESTTYPE]: 指定测试用例类型,有UT,MST,ST,PERF,FUZZ,BENCHMARK等。(必选参数) 95 -ts [TESTSUITE]: 指定测试套,可独立使用。 96 ``` 97 98### 测试报告日志 99当执行完测试指令,控制台会自动生成测试结果,若需要详细测试报告您可在相应的数据文档中进行查找。 100 101#### 测试结果 102测试结果输出根路径如下: 103``` 104Test/developer_test/reports/xxxx_xx_xx_xx_xx_xx 105 106