[env](compiler) Reduce compile time of aggregate_function_reader_replace.cpp#62047
Open
Mryange wants to merge 2 commits intoapache:masterfrom
Open
[env](compiler) Reduce compile time of aggregate_function_reader_replace.cpp#62047Mryange wants to merge 2 commits intoapache:masterfrom
Mryange wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 29394 ms |
TPC-DS: Total hot run time: 179511 ms |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 29365 ms |
TPC-DS: Total hot run time: 180110 ms |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
aggregate_function_reader_replace.cpptook 86.91s to compile because it includedaggregate_function_reader_first_last.h, which pulled in heavy template machinery: a 28-case column-type switch × 4 bool combinations × 4 factory functions = ~448make_shared<ReaderFunctionData<...>>instantiations in a single TU.How is it solved?
Decouple from
aggregate_function_reader_first_last.h: The reader/load path now has a self-contained, lightweight implementation directly in the.cppfile. The shared header is no longer included.Introduce
PointerStore<ArgIsNullable>/CopyStore<ArgIsNullable>: Two small storage classes with a uniform interface (is_null,set_value<SkipNull>,insert_into,reset). Reader path uses zero-copyPointerStore; load path usesCopyStorewithFielddeep-copy.Use 3 bool template params
<IsFirst, SkipNull, ArgIsNullable>:IsCopyis derived as!IsFirst.ArgIsNullableis resolved at registration time (nullable vs non-nullable factory map), eliminating runtime branches.result_is_nullablestays as a runtime bool (called once per group).All column operations use
IColumnvirtual dispatch: No column-type-specific template instantiations. Performance impact is negligible —Fieldoperations and theadd()virtual call itself dominate.Clean up
aggregate_function_reader_first_last.h: RemovedReaderFunctionFirstData,ReaderFunctionLastData,ReaderFunctionFirstNonNullData,ReaderFunctionLastNonNullData,ReaderFunctionData,create_function_single_value, the 28-case switch, and theCREATE_READER_FUNCTION_WITH_NAME_AND_DATAmacro — all now unused. Also removed unnecessary includes (column_array.h,column_map.h, etc.).Compile time
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)