diff --git a/src/string/bench.c b/src/string/bench.c new file mode 100644 index 0000000..fcfc1e9 --- /dev/null +++ b/src/string/bench.c @@ -0,0 +1,84 @@ +#include +#include +#include +#include "test.h" + +#define LEN 200000 + +static int bstrstr(int N, const char *needle) { + size_t l = strlen(needle); + size_t cnt = 10000; + int i; + int cs = 0; + char *haystack = malloc(l * cnt + 1); + + for (i=0; i