[Chore](hash) use google/crc32c to instead rocksdb/crc32c and crc_hash #58557
+28
−273
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
doris have crc32c from rocksdb now, but it has poorly performance than google/crc32c.
66663538 rows int
crc32c-rocksdb 684.879ms
crc32c-google 206.360ms
66663538 rows varchar
crc32c-rocksdb 1sec368ms
crc32c-google 391.290ms
We already have unit tests for rocksdb/crc32c(be/test/util/crc32c_test.cpp), so this change is safe
This pull request updates the codebase to use the more efficient and modern CRC32C hashing algorithm in place of the older CRC32 implementation. The changes include switching hash functions throughout the code, updating the CRC32C utility implementation to use an external library, and adding the required third-party dependency. This improves hash performance and consistency, and prepares the codebase for future compatibility.
Hashing algorithm migration:
Replaced all usages of
HashUtil::crc_hashwithHashUtil::crc32c_hashinblock_bloom_filter.hpp,column_dictionary.h, andfunction_string.hto utilize CRC32C for better performance and reliability. [1] [2] [3] [4]Added the new
crc32c_hashmethod toHashUtiland marked the oldcrc_hashas deprecated, retaining it only for backward compatibility with historical data. [1] [2] [3]CRC32C utility refactor and dependency management:
Refactored
crc32c.cppandcrc32c.hto use the externalcrc32clibrary, removing the previous custom implementation and lookup tables. Added new utility functions for CRC32C operations. [1] [2]Added the
crc32cthird-party dependency in the build configuration to support the new CRC32C utility.Build and header updates:
hash_util.hppto reference the new CRC32C utility.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)