MaskRay created this revision.
MaskRay added reviewers: kadircet, sammccall.
Herald added a subscriber: arphaman.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added subscribers: cfe-commits, ilya-biryukov.
Herald added a project: clang-tools-extra.
Many sources show that xxh3 is much better than xxh64. This particular
instance may or may not have noticeable difference, but this change
moves us toward removing xxHash64.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155992
Files:
clang-tools-extra/clangd/SourceCode.cpp
clang-tools-extra/clangd/index/Background.cpp
Index: clang-tools-extra/clangd/index/Background.cpp
===================================================================
--- clang-tools-extra/clangd/index/Background.cpp
+++ clang-tools-extra/clangd/index/Background.cpp
@@ -155,7 +155,7 @@
BackgroundQueue::Task BackgroundIndex::indexFileTask(std::string Path) {
std::string Tag = filenameWithoutExtension(Path).str();
- uint64_t Key = llvm::xxHash64(Path);
+ uint64_t Key = llvm::xxh3_64bits(Path);
BackgroundQueue::Task T([this, Path(std::move(Path))] {
std::optional<WithContext> WithProvidedContext;
if (ContextProvider)
Index: clang-tools-extra/clangd/SourceCode.cpp
===================================================================
--- clang-tools-extra/clangd/SourceCode.cpp
+++ clang-tools-extra/clangd/SourceCode.cpp
@@ -559,7 +559,7 @@
}
FileDigest digest(llvm::StringRef Content) {
- uint64_t Hash{llvm::xxHash64(Content)};
+ uint64_t Hash{llvm::xxh3_64bits(Content)};
FileDigest Result;
for (unsigned I = 0; I < Result.size(); ++I) {
Result[I] = uint8_t(Hash);
Index: clang-tools-extra/clangd/index/Background.cpp
===================================================================
--- clang-tools-extra/clangd/index/Background.cpp
+++ clang-tools-extra/clangd/index/Background.cpp
@@ -155,7 +155,7 @@
BackgroundQueue::Task BackgroundIndex::indexFileTask(std::string Path) {
std::string Tag = filenameWithoutExtension(Path).str();
- uint64_t Key = llvm::xxHash64(Path);
+ uint64_t Key = llvm::xxh3_64bits(Path);
BackgroundQueue::Task T([this, Path(std::move(Path))] {
std::optional<WithContext> WithProvidedContext;
if (ContextProvider)
Index: clang-tools-extra/clangd/SourceCode.cpp
===================================================================
--- clang-tools-extra/clangd/SourceCode.cpp
+++ clang-tools-extra/clangd/SourceCode.cpp
@@ -559,7 +559,7 @@
}
FileDigest digest(llvm::StringRef Content) {
- uint64_t Hash{llvm::xxHash64(Content)};
+ uint64_t Hash{llvm::xxh3_64bits(Content)};
FileDigest Result;
for (unsigned I = 0; I < Result.size(); ++I) {
Result[I] = uint8_t(Hash);
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits