feat: replace naive text analysis with SIMD-optimized trie-based multi-threaded spam detector

Rewrite the isspam.c program to use memory-mapped files, a compact trie data structure for forbidden word lookup, and pthread-based parallel processing across up to 16 threads. Remove the old fixed-size buffer and linear forbidden word array in favor of a SIMD-accelerated scanning approach with AVX2 instructions. Update the Makefile to enable aggressive x86-64 optimization flags including -march=native, -flto, -ffast-math, and -mavx2 for maximum performance on supported hardware.
This commit is contained in:
2025-10-07 18:20:58 +00:00
parent 9118d88eab
commit d86aab450c
2 changed files with 301 additions and 151 deletions
+8 -1
View File
@@ -1,5 +1,12 @@
CC = gcc
CFLAGS = -Ofast
CFLAGS = -O3 -march=native -mtune=native -flto -ffast-math \
-funroll-all-loops -finline-functions -finline-limit=10000 \
-fprefetch-loop-arrays -ftracer -fmodulo-sched \
-fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las \
-ftree-loop-distribution -ftree-loop-im -ftree-loop-ivcanon \
-fivopts -fvariable-expansion-in-unroller -fvect-cost-model=unlimited \
-mavx2 -mfma -mbmi2 -mlzcnt -mpopcnt \
-pthread
all: build run valgrind build_risspam run_risspam build_cpp build_borded_cpp build_py build_jest