Minor optimisations and bug fixes

Fix bug in mt_mpmc.c, in Linux mutexes are not recursive.
Add arena_trim_string() to the arena API
Removing arena->path, now paths are pushed to arena->metadata
Replacing fe->owner[128] with char *owner; the owner is not pushed as a
string to arena->metadata and trimed with arena_trim_string()
Improving cache locality in arena->metadata, the memory layout is not
fe; fe->path; fe->owner.
Cache aligning all arenas except HasherContext->arena to sizeof(void *).
Pushing elements one by one instead of snprintf() in finalize_file() and
hash_worker().
Getting the full path of current directory instead of "."
Fixing bug in path formating, this allow us to remove normalize_path()
from the hot loop.
This commit is contained in:
2026-05-08 15:45:57 +01:00
parent 7d2a24d0be
commit 16c6aeae65
8 changed files with 352 additions and 160 deletions

View File

@@ -1,6 +1,8 @@
@echo off
setlocal enabledelayedexpansion
set PROJECT_NAME=filehasher
:: ============================================================================
:: build.bat
:: ============================================================================
@@ -45,7 +47,7 @@ exit /b 1
:main
set BUILD_DIR=%SCRIPT_DIR%\build\windows\%BUILD_TYPE%
echo === Building filehasher (%BUILD_TYPE%) ===
echo === Building %PROJECT_NAME% (%BUILD_TYPE%) ===
:: --------------------------------------------------------------------------
:: Clean if requested
@@ -167,4 +169,4 @@ popd
echo.
echo === Build Complete ===
echo Executable: %BUILD_DIR%\filehasher.exe
echo Executable: %BUILD_DIR%\%PROJECT_NAME%.exe