feat: add C++ port of isspam with updated tokenizer and benchmark integration
Add a new C++ implementation of the isspam text analysis tool in retoor_c/isspam.cpp, mirroring the C version's functionality with thread-based file analysis. Update the Makefile with a build_cpp target and add the new binary to .gitignore. Modify bench.py to include timing for the C++ executable. Fix the C tokenizer's delimiter string from punctuation-only to include all standard whitespace characters (\f\v\r\n\t).
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Ofast
|
||||
|
||||
all: build run valgrind build_risspam run_risspam
|
||||
all: build run valgrind build_risspam run_risspam build_cpp
|
||||
|
||||
build:
|
||||
@echo "Compiling retoor_c project.".
|
||||
@# removed -pedantic flag because it doesn't accept ' for formatting numbers
|
||||
@# using printf
|
||||
@$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam
|
||||
|
||||
build_cpp:
|
||||
@echo "Compiling C++ version of isspam."
|
||||
@g++ -Ofast retoor_c/isspam.cpp -o isspam_cpp
|
||||
|
||||
build_risspam:
|
||||
@echo "Compiling 12bitfloat_risspam project."
|
||||
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
|
||||
|
||||
|
||||
run: run_spam wl run_not_spam
|
||||
run_risspam: run_spam_risspam run_not_spam_risspam
|
||||
|
||||
@@ -36,7 +36,6 @@ run_spam_risspam:
|
||||
run_not_spam_risspam:
|
||||
@./risspam ./not_spam/*.txt
|
||||
|
||||
|
||||
valgrind: build
|
||||
valgrind ./isspam ./spam/*.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user