diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-08-03 09:53:11 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-08-03 09:53:11 +0300 |
commit | d37d53fe7cc46f079193ea62fc3c5f9f83d4c6ca (patch) | |
tree | 34fb63a2022d862e75d00fbd2a7d04669e8c7a96 | |
parent | e3b7bf201afada2932564f81b66e8ed77411feeb (diff) | |
download | ydb-d37d53fe7cc46f079193ea62fc3c5f9f83d4c6ca.tar.gz |
Intermediate changes
-rw-r--r-- | yt/yt/core/misc/checksum.cpp | 17 | ||||
-rw-r--r-- | yt/yt/core/misc/checksum.h | 2 | ||||
-rw-r--r-- | yt/yt/core/misc/unittests/checksum_ut.cpp | 34 |
3 files changed, 0 insertions, 53 deletions
diff --git a/yt/yt/core/misc/checksum.cpp b/yt/yt/core/misc/checksum.cpp index 2b3aba5347..2d1951e51c 100644 --- a/yt/yt/core/misc/checksum.cpp +++ b/yt/yt/core/misc/checksum.cpp @@ -700,18 +700,6 @@ ui64 Crc(const void* buf, size_t buflen, ui64 crcinit) namespace { -// COMPAT(akozhikhov): drop this code after a while -ui64 CrcImplOld(const void* data, size_t length, ui64 seed) -{ -#ifdef YT_USE_SSE42 - static const bool Native = NX86::CachedHaveSSE42() && NX86::CachedHavePCLMUL(); - if (Native) { - return NCrcNative0xE543279765927881::Crc(data, length, seed); - } -#endif - return NCrcTable0xE543279765927881::Crc(data, length, seed); -} - ui64 CrcImpl(const void* data, size_t length, ui64 seed) { #ifdef YT_USE_SSE42 @@ -736,11 +724,6 @@ TChecksum CombineChecksums(const std::vector<TChecksum>& blockChecksums) return combined; } -TChecksum GetChecksumOld(TRef data, TChecksum seed) -{ - return CrcImplOld(data.Begin(), data.Size(), seed); -} - TChecksum GetChecksum(TRef data, TChecksum seed) { return CrcImpl(data.Begin(), data.Size(), seed); diff --git a/yt/yt/core/misc/checksum.h b/yt/yt/core/misc/checksum.h index ff597f50e1..92a3c06e1a 100644 --- a/yt/yt/core/misc/checksum.h +++ b/yt/yt/core/misc/checksum.h @@ -12,8 +12,6 @@ namespace NYT { //////////////////////////////////////////////////////////////////////////////// TChecksum GetChecksum(TRef data, TChecksum seed = 0); -// COMPAT(akozhikhov) -TChecksum GetChecksumOld(TRef data, TChecksum seed = 0); TChecksum CombineChecksums(const std::vector<TChecksum>& blockChecksums); diff --git a/yt/yt/core/misc/unittests/checksum_ut.cpp b/yt/yt/core/misc/unittests/checksum_ut.cpp index a9de7092ce..99febad6f9 100644 --- a/yt/yt/core/misc/unittests/checksum_ut.cpp +++ b/yt/yt/core/misc/unittests/checksum_ut.cpp @@ -60,40 +60,6 @@ static std::vector<TCrcTestCase> Cases = { }, }; -TEST(TChecksumTest, Ours) -{ - for (size_t i = 0; i < Cases.size(); ++i) { - auto data = TRef::FromString(Cases[i].Data); - - auto isaCrc = GetChecksum(data); - auto oldCrc = GetChecksumOld(data); - - EXPECT_EQ(oldCrc, Cases[i].Ours); - EXPECT_EQ(isaCrc, Cases[i].Ours); - } -} - - -static constexpr int IterCount = 1000; -static constexpr int BufMaxSize = 100000; - -TEST(TChecksumTest, Reference) -{ - for (size_t iter = 0; iter < IterCount; ++iter) { - auto bufSize = RandomNumber<ui64>(BufMaxSize); - auto buffer = TSharedMutableRef::Allocate(bufSize); - - for(size_t index = 0; index < bufSize; ++index) { - buffer.Begin()[index] = RandomNumber<unsigned char>(); - } - - auto isaCrc = GetChecksum(TRef(buffer)); - auto oldCrc = GetChecksumOld(TRef(buffer)); - - EXPECT_EQ(isaCrc, oldCrc); - } -} - //////////////////////////////////////////////////////////////////////////////// TEST(TChecksumTest, TestStreams) |