Skip to content

Commit 50b2161

Browse files
authored
Merge pull request #1304 from facebook/largeNbDicts
contrib/largeNbDicts
2 parents d492ef4 + c57a856 commit 50b2161

File tree

10 files changed

+893
-15
lines changed

10 files changed

+893
-15
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ contrib: lib
8888
$(MAKE) -C contrib/pzstd all
8989
$(MAKE) -C contrib/seekable_format/examples all
9090
$(MAKE) -C contrib/adaptive-compression all
91+
$(MAKE) -C contrib/largeNbDicts all
9192

9293
.PHONY: cleanTabs
9394
cleanTabs:
@@ -104,6 +105,7 @@ clean:
104105
@$(MAKE) -C contrib/pzstd $@ > $(VOID)
105106
@$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID)
106107
@$(MAKE) -C contrib/adaptive-compression $@ > $(VOID)
108+
@$(MAKE) -C contrib/largeNbDicts $@ > $(VOID)
107109
@$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
108110
@$(RM) -r lz4
109111
@echo Cleaning completed

contrib/largeNbDicts/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# build artifacts
2+
largeNbDicts

contrib/largeNbDicts/Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ################################################################
2+
# Copyright (c) 2018-present, Yann Collet, Facebook, Inc.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under both the BSD-style license (found in the
6+
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
7+
# in the COPYING file in the root directory of this source tree).
8+
# ################################################################
9+
10+
PROGDIR = ../../programs
11+
LIBDIR = ../../lib
12+
13+
LIBZSTD = $(LIBDIR)/libzstd.a
14+
15+
CPPFLAGS+= -I$(LIBDIR) -I$(LIBDIR)/common -I$(LIBDIR)/dictBuilder -I$(PROGDIR)
16+
17+
CFLAGS ?= -O3
18+
CFLAGS += -std=gnu99
19+
DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
20+
-Wstrict-aliasing=1 -Wswitch-enum \
21+
-Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
22+
-Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
23+
-Wredundant-decls
24+
CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
25+
26+
27+
default: largeNbDicts
28+
29+
all : largeNbDicts
30+
31+
largeNbDicts: bench.o datagen.o xxhash.o largeNbDicts.c $(LIBZSTD)
32+
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
33+
34+
.PHONY: $(LIBZSTD)
35+
$(LIBZSTD):
36+
$(MAKE) -C $(LIBDIR) libzstd.a
37+
38+
bench.o : $(PROGDIR)/bench.c
39+
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -c
40+
41+
datagen.o: $(PROGDIR)/datagen.c
42+
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -c
43+
44+
xxhash.o : $(LIBDIR)/common/xxhash.c
45+
$(CC) $(CPPFLAGS) $(CFLAGS) $^ -c
46+
47+
clean:
48+
$(RM) *.o
49+
$(RM) largeNbDicts

contrib/largeNbDicts/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
largeNbDicts
2+
=====================
3+
4+
`largeNbDicts` is a benchmark test tool
5+
dedicated to the specific scenario of
6+
dictionary decompression using a very large number of dictionaries.
7+
When dictionaries are constantly changing, they are always "cold",
8+
suffering from increased latency due to cache misses.
9+
10+
The tool is created in a bid to investigate performance for this scenario,
11+
and experiment mitigation techniques.
12+
13+
Command line :
14+
```
15+
largeNbDicts [Options] filename(s)
16+
17+
Options :
18+
-r : recursively load all files in subdirectories (default: off)
19+
-B# : split input into blocks of size # (default: no split)
20+
-# : use compression level # (default: 3)
21+
-D # : use # as a dictionary (default: create one)
22+
-i# : nb benchmark rounds (default: 6)
23+
--nbDicts=# : set nb of dictionaries to # (default: one per block)
24+
-h : help (this text)
25+
```

0 commit comments

Comments
 (0)