<commit_before>CC=cc

CANTERBURY = \
	alice29.txt \
	asyoulik.txt \
	cp.html \
	fields.c \
	grammar.lsp \
	kennedy.xls \
	lcet10.txt \
	sum \
	xargs.1

SILESA = \
	dickens \
	mozilla \
	mr \
	nci \
	ooffice \
	osdb \
	plrabn12.txt \
	ptt5 \
	reymont \
	samba \
	sao \
	webster \
	xml \
	x-ray

LTCB = \
	enwik8

SNAPPY = \
	fireworks.jpeg \
	geo.protodata \
	paper-100k.pdf \
	urls.10K

DATA = \
	$(CANTERBURY) \
	$(SILESA) \
	$(LTCB) \
	$(SNAPPY)

all: data.csv

%:: %.xz
	squash -kdc xz $^ $@

benchmark: benchmark.c timer.c
	$(CC) -Wall -Wextra -g -o benchmark $^ `pkg-config --libs --cflags squash-0.7`

data.csv: benchmark $(DATA)
	@if [ "`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`" != "performance" ]; then echo -e "WARNING: You should switch to the 'performance' CPU governor by running\n\n\tsu -c 'echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'\n"; fi
	./benchmark -o $@ $(sort $(DATA)) 2>&1 | tee result.log<commit_msg>Only suggest performance governor on platforms on which it can be set<commit_after>CC=cc

CANTERBURY = \
	alice29.txt \
	asyoulik.txt \
	cp.html \
	fields.c \
	grammar.lsp \
	kennedy.xls \
	lcet10.txt \
	sum \
	xargs.1

SILESA = \
	dickens \
	mozilla \
	mr \
	nci \
	ooffice \
	osdb \
	plrabn12.txt \
	ptt5 \
	reymont \
	samba \
	sao \
	webster \
	xml \
	x-ray

LTCB = \
	enwik8

SNAPPY = \
	fireworks.jpeg \
	geo.protodata \
	paper-100k.pdf \
	urls.10K

DATA = \
	$(CANTERBURY) \
	$(SILESA) \
	$(LTCB) \
	$(SNAPPY)

all: data.csv

%:: %.xz
	squash -kdc xz $^ $@

benchmark: benchmark.c timer.c
	$(CC) -Wall -Wextra -g -o benchmark $^ `pkg-config --libs --cflags squash-0.7`

data.csv: benchmark $(DATA)
	@if [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor -a "`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`" != "performance" ]; then echo -e "WARNING: You should switch to the 'performance' CPU governor by running\n\n\tsu -c 'echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'\n"; fi
	./benchmark -o $@ $(sort $(DATA)) 2>&1 | tee result.log
{'fraction_non_alphanumeric': 0.16199226305609285, 'fraction_numerical': 0.018858800773694392, 'mean_word_length': 2.6684397163120566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '27399', 'n_tokens_mistral': 969, 'n_tokens_neox': 919, 'n_words': 195}