##// END OF EJS Templates
bookmarks: cache reverse mapping (issue5868)...
bookmarks: cache reverse mapping (issue5868) I chose a simpler implementation. If the initial cost of building reverse mapping is significant, we'll have to move it under @propertycache. The nodemap could be a dict of sets, but I think keeping a sorted list is better since each node is likely to have zero/one bookmark. Micro-benchmark with 1001 bookmarks and 1001 revisions: $ for n in `seq 0 1000`; do touch $n; hg book book$n; hg ci -qAm$n; done $ hg bookmarks --time > /dev/null (orig) time: real 0.040 secs (user 0.050+0.000 sys 0.000+0.000) (new) time: real 0.040 secs (user 0.040+0.000 sys 0.010+0.000) $ hg log -T '{bookmarks}\n' --time > /dev/null (orig) time: real 0.160 secs (user 0.160+0.000 sys 0.000+0.000) (new) time: real 0.090 secs (user 0.100+0.000 sys 0.000+0.000)

File last commit:

r36783:04d64163 default
r38106:04ceb267 @26 default
Show More
Makefile
40 lines | 1.3 KiB | text/x-makefile | MakefileLexer
bdiff.o: ../../mercurial/bdiff.c
clang -g -O1 -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
../../mercurial/bdiff.c
bdiff: bdiff.cc bdiff.o
clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
-I../../mercurial bdiff.cc bdiff.o -o bdiff
bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
$$CC $$CFLAGS -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o
$$CXX $$CXXFLAGS -std=c++11 -I../../mercurial bdiff.cc \
bdiff-oss-fuzz.o -lFuzzingEngine -o $$OUT/bdiff_fuzzer
x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
clang -g -O1 -fsanitize=fuzzer-no-link,address -c \
-o $@ \
$<
xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o
clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
-I../../mercurial xdiff.cc \
xdiffi.o xprepare.o xutils.o -o xdiff
fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
$$CC $$CFLAGS -c \
-o $@ \
$<
xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o
$$CXX $$CXXFLAGS -std=c++11 -I../../mercurial xdiff.cc \
fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
-lFuzzingEngine -o $$OUT/xdiff_fuzzer
all: bdiff xdiff
oss-fuzz: bdiff_fuzzer xdiff_fuzzer
.PHONY: all oss-fuzz