ClickHouse/utils/check-style/check-large-objects.sh
Azat Khuzhin cf3cd099a5 Split HashedDictionary CU
Before HashedDictionary.cpp exceeds 50MiB, now:

    -rw-r--r-- 1 azat azat  37M Nov 22 17:56 SparseHashedDictionary.cpp.o
    -rw-r--r-- 1 azat azat  34M Nov 22 17:56 HashedDictionary.cpp.o
    -rw-r--r-- 1 azat azat 716K Nov 22 17:56 registerHashedDictionary.cpp.o

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-11-22 19:00:40 +01:00

23 lines
552 B
Bash
Executable File

#!/usr/bin/env bash
# Check that there are no new translation units compiled to an object file larger than a certain size.
TU_EXCLUDES=(
CastOverloadResolver
AggregateFunctionMax
AggregateFunctionMin
AggregateFunctionUniq
FunctionsConversion
RangeHashedDictionary
Aggregator
)
if find $1 -name '*.o' | xargs wc -c | grep -v total | sort -rn | awk '{ if ($1 > 50000000) print }' \
| grep -v -f <(printf "%s\n" "${TU_EXCLUDES[@]}")
then
echo "^ It's not allowed to have so large translation units."
exit 1
fi