mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
deinit obj in benchmark
This commit is contained in:
parent
962086ddbd
commit
047c62ecf2
@ -18,6 +18,7 @@ static void for_loop_10000(benchmark::State& state) {
|
|||||||
"for i in range(0, 10000):\n"
|
"for i in range(0, 10000):\n"
|
||||||
" a = a + 1\n"
|
" a = a + 1\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
obj_deinit(pikaMain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BENCHMARK(for_loop_10000)->Unit(benchmark::kMillisecond);
|
BENCHMARK(for_loop_10000)->Unit(benchmark::kMillisecond);
|
||||||
@ -31,6 +32,7 @@ static void while_loop_10000(benchmark::State& state) {
|
|||||||
"while i < 10000:\n"
|
"while i < 10000:\n"
|
||||||
" i = i + 1\n"
|
" i = i + 1\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
obj_deinit(pikaMain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BENCHMARK(while_loop_10000)->Unit(benchmark::kMillisecond);
|
BENCHMARK(while_loop_10000)->Unit(benchmark::kMillisecond);
|
||||||
@ -57,11 +59,11 @@ static void prime_number_100(benchmark::State& state) {
|
|||||||
if (1060 != num) {
|
if (1060 != num) {
|
||||||
printf("[error]: prime_number_100\r\n");
|
printf("[error]: prime_number_100\r\n");
|
||||||
}
|
}
|
||||||
|
obj_deinit(pikaMain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BENCHMARK(prime_number_100)->Unit(benchmark::kMillisecond);
|
BENCHMARK(prime_number_100)->Unit(benchmark::kMillisecond);
|
||||||
|
|
||||||
BENCHMARK_MAIN();
|
|
||||||
|
|
||||||
static void prime_number_100_c(benchmark::State& state) {
|
static void prime_number_100_c(benchmark::State& state) {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
@ -86,3 +88,5 @@ static void prime_number_100_c(benchmark::State& state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BENCHMARK(prime_number_100_c)->Unit(benchmark::kMillisecond);
|
BENCHMARK(prime_number_100_c)->Unit(benchmark::kMillisecond);
|
||||||
|
|
||||||
|
BENCHMARK_MAIN();
|
@ -1,4 +1,4 @@
|
|||||||
cd Release && make -j
|
cd Release && make -j
|
||||||
cd ..
|
cd ..
|
||||||
Release/benchmark/pikascript_benchmark --benchmark_format=json | tee benchmark_result.json
|
bash ci_benchmark_run.sh
|
||||||
python3 ci_benchmark_calibration.py
|
python3 ci_benchmark_calibration.py
|
||||||
|
1
port/linux/ci_benchmark_run.sh
Executable file
1
port/linux/ci_benchmark_run.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
Release/benchmark/pikascript_benchmark --benchmark_format=json | tee benchmark_result.json
|
Loading…
x
Reference in New Issue
Block a user