From 04a96b059faac8100a291e56bfbdb1962d53d4e1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 6 Feb 2024 21:57:17 +1100 Subject: Use different hash algorithms for strings and file hashing For hash map, using fnv1a is faster as it is a much simpler algorithm we can afford to inline. For files murmur3 should win as it processes bytes 4 by 4. --- src/file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/file.cc') diff --git a/src/file.cc b/src/file.cc index 87112e24..56d7b027 100644 --- a/src/file.cc +++ b/src/file.cc @@ -626,7 +626,7 @@ FsStatus get_fs_status(StringView filename) { MappedFile fd{filename}; - return {fd.st.st_mtim, fd.st.st_size, hash_data(fd.data, fd.st.st_size)}; + return {fd.st.st_mtim, fd.st.st_size, murmur3(fd.data, fd.st.st_size)}; } String get_kak_binary_path() -- cgit v1.2.3