Compare commits
No commits in common. "de8cbb23b51fd01efb3ea4588dea9dd6ca5c2782" and "97529fdd2b3a42b61ce8cf6f740ccd8e495a801d" have entirely different histories.
de8cbb23b5
...
97529fdd2b
@ -11,7 +11,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define LEN 1000
|
||||
#define LEN 100
|
||||
#define RANGE_FIRST 'a'
|
||||
#define RANGE_LAST 'z'
|
||||
|
||||
@ -31,11 +31,9 @@ static void matching_benchmark(const fsa_t *fsa)
|
||||
for (int j = 0; j < LEN; ++j)
|
||||
s[j] = CLAMP_CHAR(rand());
|
||||
|
||||
volatile bool match;
|
||||
START_CLOCK();
|
||||
match = fsa_accepts(fsa, s, LEN);
|
||||
fsa_accepts(fsa, s, LEN);
|
||||
STOP_CLOCK();
|
||||
(void)match;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
@ -46,9 +44,9 @@ int main(void)
|
||||
|
||||
BENCHMARKING_BEGIN();
|
||||
|
||||
RUN_MATCHING_BENCHMARK(100000, "foo or bar", ".*(foo|bar).*");
|
||||
RUN_MATCHING_BENCHMARK(100000, "regex #1", ".*(abc!?)*|dd+.*");
|
||||
RUN_MATCHING_BENCHMARK(100000, "regex #2", ".*(l|wh)?[aeiou]+.*");
|
||||
RUN_MATCHING_BENCHMARK(10000, "foo or bar", ".*(foo|bar).*");
|
||||
RUN_MATCHING_BENCHMARK(10000, "regex #1", ".*(abc!?)*|dd+.*");
|
||||
RUN_MATCHING_BENCHMARK(10000, "regex #2", ".*(l|wh)?[aeiou]+.*");
|
||||
|
||||
return BENCHMARKING_END();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user