Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
Add a flag to allow disabling of Comparison inline expansion to enabl…
Browse files Browse the repository at this point in the history
…e acceleration of Quickstep build.

(for development productivity as well as solving the Travis CI timeout problem)
  • Loading branch information
jianqiao committed Feb 2, 2018
1 parent 4a945a6 commit 539e1eb
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -76,7 +76,8 @@ before_script:
-D CMAKE_CXX_COMPILER=$CXX
-D CMAKE_LINKER=$CLINKER
-D USE_TCMALLOC=0
-D VECTOR_COPY_ELISION_LEVEL=$VECTOR_COPY_ELISION_LEVEL ..)
-D VECTOR_COPY_ELISION_LEVEL=$VECTOR_COPY_ELISION_LEVEL
-D ENABLE_COMPARISON_INLINE_EXPANSION=OFF ..)

script:
- ./lint_everything.py
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Expand Up @@ -145,6 +145,20 @@ if (ENABLE_VECTOR_PREDICATE_SHORT_CIRCUIT)
)
endif()

set(COMPARISON_INLINE_EXPANSION_MSG_LIST
"This option controls whether to enable inlined template expansion "
"of comparison predicates. WARNING: This option should only be "
"turned off for development use. Turning off this option will greatly "
"reduce Quickstep compile time but incur drastic performance degradation.")
string(REPLACE ";" "" COMPARISON_INLINE_EXPANSION_MSG ${COMPARISON_INLINE_EXPANSION_MSG_LIST})
option(ENABLE_COMPARISON_INLINE_EXPANSION ${COMPARISON_INLINE_EXPANSION_MSG} ON)
if (ENABLE_COMPARISON_INLINE_EXPANSION)
set_property(
DIRECTORY
APPEND PROPERTY COMPILE_DEFINITIONS QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
)
endif()

option(ENABLE_NETWORK_CLI "Allows use of the network cli" OFF)
option(ENABLE_DISTRIBUTED "Use the distributed version of Quickstep" OFF)

Expand Down
2 changes: 2 additions & 0 deletions types/operations/comparisons/AsciiStringComparators-inl.hpp
Expand Up @@ -46,6 +46,7 @@

namespace quickstep {

#ifdef QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
template <template <typename T> class ComparisonFunctor,
bool left_nullable, bool left_null_terminated, bool left_longer,
bool right_nullable, bool right_null_terminated, bool right_longer>
Expand Down Expand Up @@ -586,6 +587,7 @@ TypedValue AsciiStringUncheckedComparator<ComparisonFunctor,

return new_value;
}
#endif // QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION

} // namespace quickstep

Expand Down
4 changes: 4 additions & 0 deletions types/operations/comparisons/AsciiStringComparators.hpp
Expand Up @@ -122,6 +122,7 @@ class AsciiStringUncheckedComparator : public UncheckedComparator {
0);
}

#ifdef QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
TupleIdSequence* compareColumnVectors(
const ColumnVector &left,
const ColumnVector &right,
Expand Down Expand Up @@ -202,6 +203,7 @@ class AsciiStringUncheckedComparator : public UncheckedComparator {
TypedValue accumulateColumnVector(
const TypedValue &current,
const ColumnVector &column_vector) const override;
#endif // QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION

private:
/**
Expand Down Expand Up @@ -248,6 +250,7 @@ class AsciiStringUncheckedComparator : public UncheckedComparator {
}
}

#ifdef QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
template <bool column_vector_on_left>
TupleIdSequence* compareColumnVectorAndStaticValueHelper(
const ColumnVector &column_vector,
Expand All @@ -271,6 +274,7 @@ class AsciiStringUncheckedComparator : public UncheckedComparator {
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const;
#endif // QUICKSTEP_ENABLE_VECTOR_COPY_ELISION_SELECTION
#endif // QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION

template <bool arguments_in_order>
inline bool compareDataPtrsHelper(const void *left, const void *right) const {
Expand Down
20 changes: 0 additions & 20 deletions types/operations/comparisons/Comparison.cpp
Expand Up @@ -33,8 +33,6 @@ TupleIdSequence* UncheckedComparator::compareColumnVectors(
const ColumnVector &right,
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareColumnVectors()");
return compareColumnVectorsDefaultImpl<true, true>(
left, right, filter, existence_bitmap);
}
Expand All @@ -44,8 +42,6 @@ TupleIdSequence* UncheckedComparator::compareColumnVectorAndStaticValue(
const TypedValue &right,
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareColumnVectorAndStaticValue()");
return compareColumnVectorAndStaticValueDefaultImpl<true, true>(
left, right, filter, existence_bitmap);
}
Expand All @@ -55,8 +51,6 @@ TupleIdSequence* UncheckedComparator::compareStaticValueAndColumnVector(
const ColumnVector &right,
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareStaticValueAndColumnVector()");
return compareStaticValueAndColumnVectorDefaultImpl<true, true>(
left, right, filter, existence_bitmap);
}
Expand All @@ -67,8 +61,6 @@ TupleIdSequence* UncheckedComparator::compareSingleValueAccessor(
const attribute_id left_id,
const attribute_id right_id,
const TupleIdSequence *filter) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareSingleValueAccessor()");
return compareSingleValueAccessorDefaultImpl<true, true>(
accessor, left_id, right_id, filter);
}
Expand All @@ -78,8 +70,6 @@ TupleIdSequence* UncheckedComparator::compareValueAccessorAndStaticValue(
const attribute_id left_id,
const TypedValue &right,
const TupleIdSequence *filter) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareValueAccessorAndStaticValue()");
return compareValueAccessorAndStaticValueDefaultImpl<true, true>(
left_accessor, left_id, right, filter);
}
Expand All @@ -89,8 +79,6 @@ TupleIdSequence* UncheckedComparator::compareStaticValueAndValueAccessor(
ValueAccessor *right_accessor,
const attribute_id right_id,
const TupleIdSequence *filter) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareStaticValueAndValueAccessor()");
return compareStaticValueAndValueAccessorDefaultImpl<true, true>(
left, right_accessor, right_id, filter);
}
Expand All @@ -101,8 +89,6 @@ TupleIdSequence* UncheckedComparator::compareColumnVectorAndValueAccessor(
const attribute_id right_id,
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareColumnVectorAndValueAccessor()");
return compareColumnVectorAndValueAccessorDefaultImpl<true, true>(
left, right_accessor, right_id, filter, existence_bitmap);
}
Expand All @@ -113,8 +99,6 @@ TupleIdSequence* UncheckedComparator::compareValueAccessorAndColumnVector(
const ColumnVector &right,
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::compareValueAccessorAndColumnVector()");
return compareValueAccessorAndColumnVectorDefaultImpl<true, true>(
left_accessor, left_id, right, filter, existence_bitmap);
}
Expand All @@ -123,8 +107,6 @@ TypedValue UncheckedComparator::accumulateValueAccessor(
const TypedValue &current,
ValueAccessor *accessor,
const attribute_id value_accessor_id) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::accumulateValueAccessor()");
return accumulateValueAccessorDefaultImpl<true>(
current, accessor, value_accessor_id);
}
Expand All @@ -133,8 +115,6 @@ TypedValue UncheckedComparator::accumulateValueAccessor(
TypedValue UncheckedComparator::accumulateColumnVector(
const TypedValue &current,
const ColumnVector &column_vector) const {
DEV_WARNING("Using fallback non-specialized implementation of "
"UncheckedComparator::accumulateColumnVector()");
return accumulateColumnVectorDefaultImpl<true>(current, column_vector);
}

Expand Down
2 changes: 2 additions & 0 deletions types/operations/comparisons/LiteralComparators-inl.hpp
Expand Up @@ -46,6 +46,7 @@

namespace quickstep {

#ifdef QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
template <template <typename LeftArgument, typename RightArgument> class ComparisonFunctor,
typename LeftCppType, bool left_nullable,
typename RightCppType, bool right_nullable>
Expand Down Expand Up @@ -662,6 +663,7 @@ TypedValue LiteralUncheckedComparator<ComparisonFunctor,
return TypedValue(current.getTypeID());
}
}
#endif // QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION

} // namespace quickstep

Expand Down
4 changes: 4 additions & 0 deletions types/operations/comparisons/LiteralComparators.hpp
Expand Up @@ -143,6 +143,7 @@ class LiteralUncheckedComparator : public UncheckedComparator {
right.getLiteral<RightCppType>());
}

#ifdef QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
TupleIdSequence* compareColumnVectors(
const ColumnVector &left,
const ColumnVector &right,
Expand Down Expand Up @@ -223,8 +224,10 @@ class LiteralUncheckedComparator : public UncheckedComparator {
TypedValue accumulateColumnVector(
const TypedValue &current,
const ColumnVector &column_vector) const override;
#endif // QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION

private:
#ifdef QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION
template <bool column_vector_on_left>
TupleIdSequence* compareColumnVectorAndStaticValueHelper(
const ColumnVector &column_vector,
Expand All @@ -248,6 +251,7 @@ class LiteralUncheckedComparator : public UncheckedComparator {
const TupleIdSequence *filter,
const TupleIdSequence *existence_bitmap) const;
#endif // QUICKSTEP_ENABLE_VECTOR_COPY_ELISION_SELECTION
#endif // QUICKSTEP_ENABLE_COMPARISON_INLINE_EXPANSION

template <bool arguments_in_order>
inline bool compareDataPtrsHelper(const void *left, const void *right) const {
Expand Down

0 comments on commit 539e1eb

Please sign in to comment.