Compare commits
2 Commits
main
...
5d109f5f06
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d109f5f06 | |||
| e1b5725e74 |
@@ -6,7 +6,7 @@ function(add_benchmark_suite source)
|
|||||||
string(REGEX REPLACE ".c$" "" name ${source})
|
string(REGEX REPLACE ".c$" "" name ${source})
|
||||||
add_executable(${name} ${source})
|
add_executable(${name} ${source})
|
||||||
set_default_target_options(${name})
|
set_default_target_options(${name})
|
||||||
target_link_libraries(${name} PRIVATE lib benchmarking m)
|
target_link_libraries(${name} PRIVATE lib benchmarking)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(add_benchmark_suites)
|
function(add_benchmark_suites)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#define LEN 1000
|
#define LEN 100
|
||||||
#define RANGE_FIRST 'a'
|
#define RANGE_FIRST 'a'
|
||||||
#define RANGE_LAST 'z'
|
#define RANGE_LAST 'z'
|
||||||
|
|
||||||
@@ -31,11 +31,9 @@ static void matching_benchmark(const fsa_t *fsa)
|
|||||||
for (int j = 0; j < LEN; ++j)
|
for (int j = 0; j < LEN; ++j)
|
||||||
s[j] = CLAMP_CHAR(rand());
|
s[j] = CLAMP_CHAR(rand());
|
||||||
|
|
||||||
volatile bool match;
|
|
||||||
START_CLOCK();
|
START_CLOCK();
|
||||||
match = fsa_accepts(fsa, s, LEN);
|
fsa_accepts(fsa, s, LEN);
|
||||||
STOP_CLOCK();
|
STOP_CLOCK();
|
||||||
(void)match;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user