This commit is contained in:
retoor 2025-03-23 03:25:51 +01:00
parent 611ef8d124
commit fe0357b5d5
2 changed files with 8 additions and 1 deletions

View File

@ -1,12 +1,16 @@
CC = gcc CC = gcc
CFLAGS = -Ofast CFLAGS = -Ofast
all: build run valgrind build_risspam run_risspam build_cpp build_borded_cpp all: build run valgrind build_risspam run_risspam build_cpp build_borded_cpp build_py
build: build:
@echo "Compiling retoor_c project.". @echo "Compiling retoor_c project.".
@$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam @$(CC) $(CFLAGS) retoor_c/isspam.c -o isspam
build_py:
@echo "Copying py file"
@cp retoor_c/isspam.py isspam.py
build_cpp: build_cpp:
@echo "Compiling C++ version of isspam." @echo "Compiling C++ version of isspam."
@g++ -Ofast retoor_c/isspam.cpp -o isspam_cpp @g++ -Ofast retoor_c/isspam.cpp -o isspam_cpp

View File

@ -14,4 +14,7 @@ print("Time CPP:",time.time() - time_start)
time_start = time.time() time_start = time.time()
subprocess.check_output('./borded_cpp_exec books/*.txt', shell=True) subprocess.check_output('./borded_cpp_exec books/*.txt', shell=True)
print("Time Borded CPP:",time.time() - time_start) print("Time Borded CPP:",time.time() - time_start)
time_start = time.time()
subprocess.check_output('python3 isspam.py books/*.txt', shell=True)
print("Time Retoor Python:",time.time() - time_start)
print("***end benchmark***") print("***end benchmark***")