feat: add benchmark target to Makefile and optimize isspam.c with stricmp

- Add 'benchmark' target to Makefile that extracts books archive and runs bench.py
- Reorder includes in isspam.c (rstr.h before rstring_list.h)
- Replace file_exists() with case-insensitive stricmp() for forbidden word matching
- Remove unused flags (show_capitalized, show_sentences, etc.) and stripws() function
- Add memory usage comment and fix trailing newline in rstr.h header guard
This commit is contained in:
2024-12-01 21:02:32 +00:00
parent 8b7f05b129
commit ef3c9b5c5b
4 changed files with 124 additions and 171 deletions
+8 -1
View File
@@ -1,7 +1,7 @@
CC = gcc
CFLAGS = -Wall -Werror -Wextra -Ofast -std=c2x
all: build run valgrind build_risspam run_risspam
all: build run valgrind build_risspam run_risspam benchmark
build:
@echo "Compiling retoor_c project.".
@@ -39,3 +39,10 @@ run_not_spam_risspam:
valgrind: build
valgrind ./isspam ./spam/*.txt
benchmark:
-@rm -rf books
echo "Extracting books."
tar -xzf books.tar.gz books/
echo "Extracted books."
python bench.py