mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
better
This commit is contained in:
parent
5e65aff3fd
commit
c127c433c2
@ -154,6 +154,10 @@ def parse_env_variables(build_type, compiler, sanitizer, package_type, image_typ
|
|||||||
|
|
||||||
if clang_tidy:
|
if clang_tidy:
|
||||||
cmake_flags.append('-DENABLE_CLANG_TIDY=1')
|
cmake_flags.append('-DENABLE_CLANG_TIDY=1')
|
||||||
|
cmake_flags.append('-DENABLE_UTILS=1')
|
||||||
|
cmake_flags.append('-DUSE_GTEST=1')
|
||||||
|
cmake_flags.append('-DENABLE_TESTS=1')
|
||||||
|
cmake_flags.append('-DENABLE_EXAMPLES=1')
|
||||||
# Don't stop on first error to find more clang-tidy errors in one run.
|
# Don't stop on first error to find more clang-tidy errors in one run.
|
||||||
result.append('NINJA_FLAGS=-k0')
|
result.append('NINJA_FLAGS=-k0')
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public:
|
|||||||
using list_type = std::list<std::pair<key_type, value_type>>;
|
using list_type = std::list<std::pair<key_type, value_type>>;
|
||||||
using map_type = std::unordered_map<key_type, typename list_type::iterator>;
|
using map_type = std::unordered_map<key_type, typename list_type::iterator>;
|
||||||
|
|
||||||
LRUHashMapBasic(size_t max_size_, bool preallocated = false)
|
explicit LRUHashMapBasic(size_t max_size_, bool preallocated = false)
|
||||||
: hash_map(preallocated ? max_size_ : 32)
|
: hash_map(preallocated ? max_size_ : 32)
|
||||||
, max_size(max_size_)
|
, max_size(max_size_)
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@ struct AggregateIndependentWithSequentialKeysOptimization
|
|||||||
if (it != begin && *it == prev_key)
|
if (it != begin && *it == prev_key)
|
||||||
{
|
{
|
||||||
assert(place != nullptr);
|
assert(place != nullptr);
|
||||||
updater(place->getMapped());
|
updater(place->getMapped()); // NOLINT
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
prev_key = *it;
|
prev_key = *it;
|
||||||
|
@ -26,6 +26,7 @@ namespace ErrorCodes
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// NOLINTNEXTLINE(cert-dcl50-cpp)
|
||||||
__attribute__((__noinline__)) int64_t our_syscall(...)
|
__attribute__((__noinline__)) int64_t our_syscall(...)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__ (R"(
|
__asm__ __volatile__ (R"(
|
||||||
|
@ -55,7 +55,7 @@ ColumnPtr FunctionReplicate::executeImpl(const ColumnsWithTypeAndName & argument
|
|||||||
offsets = array_column->getOffsetsPtr();
|
offsets = array_column->getOffsetsPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto & offsets_data = assert_cast<const ColumnArray::ColumnOffsets &>(*offsets).getData();
|
const auto & offsets_data = assert_cast<const ColumnArray::ColumnOffsets &>(*offsets).getData(); /// NOLINT
|
||||||
return ColumnArray::create(first_column->replicate(offsets_data)->convertToFullColumnIfConst(), offsets);
|
return ColumnArray::create(first_column->replicate(offsets_data)->convertToFullColumnIfConst(), offsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,8 @@ int main(int argc, char ** argv)
|
|||||||
<< "Written " << n << " numbers (" << wb.count() / 1000000.0 << " MB) in " << watch.elapsedSeconds() << " sec., "
|
<< "Written " << n << " numbers (" << wb.count() / 1000000.0 << " MB) in " << watch.elapsedSeconds() << " sec., "
|
||||||
<< n / watch.elapsedSeconds() << " num/s., "
|
<< n / watch.elapsedSeconds() << " num/s., "
|
||||||
<< wb.count() / watch.elapsedSeconds() / 1000000 << " MB/s., "
|
<< wb.count() / watch.elapsedSeconds() / 1000000 << " MB/s., "
|
||||||
<< watch.elapsed() / n << " ns/num., "
|
<< watch.elapsed() / n << " ns/num., " // NOLINT
|
||||||
<< tsc / n << " ticks/num., "
|
<< tsc / n << " ticks/num., " // NOLINT
|
||||||
<< watch.elapsed() / wb.count() << " ns/byte., "
|
<< watch.elapsed() / wb.count() << " ns/byte., "
|
||||||
<< tsc / wb.count() << " ticks/byte."
|
<< tsc / wb.count() << " ticks/byte."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -73,8 +73,7 @@ void testCreateList(zkutil::ZooKeeper & zk)
|
|||||||
void testCreateSetVersionRequest(zkutil::ZooKeeper & zk)
|
void testCreateSetVersionRequest(zkutil::ZooKeeper & zk)
|
||||||
{
|
{
|
||||||
zk.create("/data/check_data", "d", zkutil::CreateMode::Persistent);
|
zk.create("/data/check_data", "d", zkutil::CreateMode::Persistent);
|
||||||
Coordination::Stat stat;
|
Coordination::Stat stat{};
|
||||||
std::string result = zk.get("/data/check_data", &stat);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
zk.set("/data/check_data", "e", stat.version + 2);
|
zk.set("/data/check_data", "e", stat.version + 2);
|
||||||
@ -224,7 +223,7 @@ std::string random_string(size_t length)
|
|||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
"abcdefghijklmnopqrstuvwxyz";
|
"abcdefghijklmnopqrstuvwxyz";
|
||||||
const size_t max_index = (sizeof(charset) - 1);
|
const size_t max_index = (sizeof(charset) - 1);
|
||||||
return charset[rand() % max_index];
|
return charset[rand() % max_index]; /// NOLINT
|
||||||
};
|
};
|
||||||
std::string str(length, 0);
|
std::string str(length, 0);
|
||||||
std::generate_n(str.begin(), length, randchar);
|
std::generate_n(str.begin(), length, randchar);
|
||||||
@ -259,8 +258,8 @@ void createOnPrefix(const std::string & zkhost, const String & path_prefix, size
|
|||||||
holder_futures.push_back(zk.asyncCreate(path, random_string(datasize), zkutil::CreateMode::Persistent));
|
holder_futures.push_back(zk.asyncCreate(path, random_string(datasize), zkutil::CreateMode::Persistent));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < holder_futures.size(); ++i)
|
for (auto & future : holder_futures)
|
||||||
holder_futures[i].get();
|
future.get();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user