Skip to content

Commit

Permalink
Upgrade to xxhash 0.8.2 as a Conan requirement, enable SIMD hashing (#…
Browse files Browse the repository at this point in the history
…4893)

We are currently using old version 0.6.2 of `xxhash`, as a verbatim copy and paste of its header file `xxhash.h`. Switch to the more recent version 0.8.2. Since this version is in Conan Center (and properly protects its ABI by keeping the state object incomplete), add it as a Conan requirement. Switch to the SIMD instructions (in the new `XXH3` family) supported by the new version.
  • Loading branch information
Bronek authored Mar 13, 2024
1 parent 5cc3777 commit 2ffead7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 1,187 deletions.
7 changes: 2 additions & 5 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ target_sources (xrpl_core PRIVATE
src/ripple/beast/clock/basic_seconds_clock.cpp
src/ripple/beast/core/CurrentThreadName.cpp
src/ripple/beast/core/SemanticVersion.cpp
src/ripple/beast/hash/impl/xxhash.cpp
src/ripple/beast/insight/impl/Collector.cpp
src/ripple/beast/insight/impl/Groups.cpp
src/ripple/beast/insight/impl/Hook.cpp
Expand Down Expand Up @@ -153,7 +152,8 @@ target_link_libraries (xrpl_core
secp256k1::secp256k1
ed25519::ed25519
date::date
Ripple::opts)
Ripple::opts
xxHash::xxhash)
#[=================================[
main/core headers installation
#]=================================]
Expand Down Expand Up @@ -362,9 +362,6 @@ install (
src/ripple/beast/hash/uhash.h
src/ripple/beast/hash/xxhasher.h
DESTINATION include/ripple/beast/hash)
install (
FILES src/ripple/beast/hash/impl/xxhash.h
DESTINATION include/ripple/beast/hash/impl)
install (
FILES
src/ripple/beast/net/IPAddress.h
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ endif()

find_package(nudb REQUIRED)
find_package(date REQUIRED)
find_package(xxHash REQUIRED)

target_link_libraries(ripple_libs INTERFACE
ed25519::ed25519
Expand Down
3 changes: 3 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Xrpl(ConanFile):
'soci/4.0.3',
'sqlite3/3.42.0',
'zlib/1.2.13',
'xxhash/0.8.2',
]

default_options = {
Expand Down Expand Up @@ -86,6 +87,7 @@ class Xrpl(ConanFile):
'soci:shared': False,
'soci:with_sqlite3': True,
'soci:with_boost': True,
'xxhash:shared': False,
}

def set_version(self):
Expand Down Expand Up @@ -159,4 +161,5 @@ def package_info(self):
'openssl::crypto',
'date::date',
'grpc::grpc++',
'xxHash::xxhash',
]
Loading

0 comments on commit 2ffead7

Please sign in to comment.