projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3a72706
)
include makefile.conf later, reset_timer in strstr bench
author
nsz
<nsz@port70.net>
Mon, 8 Aug 2011 16:35:31 +0000
(18:35 +0200)
committer
nsz
<nsz@port70.net>
Mon, 8 Aug 2011 16:35:31 +0000
(18:35 +0200)
Makefile.inc
patch
|
blob
|
history
src/string/bench.c
patch
|
blob
|
history
diff --git
a/Makefile.inc
b/Makefile.inc
index
f163fda
..
ae2fa3f
100644
(file)
--- a/
Makefile.inc
+++ b/
Makefile.inc
@@
-14,7
+14,6
@@
usemusl = yes
prefix = /usr/local/musl
includedir = $(prefix)/include
libdir = $(prefix)/lib
prefix = /usr/local/musl
includedir = $(prefix)/include
libdir = $(prefix)/lib
--include $(ROOTDIR)/Makefile.conf
AR=ar
RANLIB=ranlib
AR=ar
RANLIB=ranlib
@@
-23,6
+22,8
@@
CFLAGS += -g -D_POSIX_C_SOURCE=200809L -std=c99 -pipe -Wall
LDFLAGS += -g -lpthread -lrt -lm
INC += -I$(ROOTDIR)/common
LDFLAGS += -g -lpthread -lrt -lm
INC += -I$(ROOTDIR)/common
+-include $(ROOTDIR)/Makefile.conf
+
ifeq ($(usemusl), yes)
CC=gcc
LIBCC=$(shell gcc -print-file-name=libgcc.a |sed 's,/libgcc.a,,')
ifeq ($(usemusl), yes)
CC=gcc
LIBCC=$(shell gcc -print-file-name=libgcc.a |sed 's,/libgcc.a,,')
diff --git
a/src/string/bench.c
b/src/string/bench.c
index
fcfc1e9
..
9f0a7f5
100644
(file)
--- a/
src/string/bench.c
+++ b/
src/string/bench.c
@@
-17,6
+17,7
@@
static int bstrstr(int N, const char *needle) {
haystack[l*i+l-1] ^= 1;
}
memcpy(haystack + l*i, needle, l+1);
haystack[l*i+l-1] ^= 1;
}
memcpy(haystack + l*i, needle, l+1);
+ reset_timer();
for (i=0; i<N; i++) {
haystack[0]^=1;
cs += (int)strstr(haystack, needle);
for (i=0; i<N; i++) {
haystack[0]^=1;
cs += (int)strstr(haystack, needle);