Use high-performance FindMatchLength to Optimize Snappy compression speed For RISC-V[skip ci]

This commit is contained in:
anthony-zy
2025-07-29 14:08:43 +08:00
parent 6af9287fbd
commit 758804a4bc

View File

@@ -172,9 +172,10 @@ char* CompressFragment(const char* input,
// loading from s2 + n. // loading from s2 + n.
// //
// Separate implementation for 64-bit, little-endian cpus. // Separate implementation for 64-bit, little-endian cpus.
// riscv and little-endian cpu choose this routinue can be done faster too.
#if !SNAPPY_IS_BIG_ENDIAN && \ #if !SNAPPY_IS_BIG_ENDIAN && \
(defined(__x86_64__) || defined(_M_X64) || defined(ARCH_PPC) || \ (defined(__x86_64__) || defined(_M_X64) || defined(ARCH_PPC) || \
defined(ARCH_ARM)) defined(ARCH_ARM) || defined(__riscv))
static inline std::pair<size_t, bool> FindMatchLength(const char* s1, static inline std::pair<size_t, bool> FindMatchLength(const char* s1,
const char* s2, const char* s2,
const char* s2_limit, const char* s2_limit,