morningman commented on code in PR #66712:
URL: https://github.com/apache/doris/pull/66712#discussion_r3774458995
##########
build.sh:
##########
@@ -943,6 +944,7 @@ if [[ "${BUILD_BE}" -eq 1 ]]; then
-DSTRIP_DEBUG_INFO="${STRIP_DEBUG_INFO}" \
-DDISPLAY_BUILD_TIME="${DISPLAY_BUILD_TIME}" \
-DENABLE_PCH="${ENABLE_PCH}" \
+ -DENABLE_UNITY_BUILD="${ENABLE_UNITY_BUILD:-ON}" \
Review Comment:
Fixed in 0dcc67c8e37 — `run-be-ut.sh` now forwards `-DENABLE_UNITY_BUILD`
and reports the effective value next to `ENABLE_PCH`.
One correction to the report: the gap was wider than `--clean`. Since the
script never passed the variable at all, the very first configure cached the
option default `ON` and no later run could change it, so
`ENABLE_UNITY_BUILD=OFF ./run-be-ut.sh` was inert with or without `--clean`.
##########
be/src/information_schema/CMakeLists.txt:
##########
@@ -25,3 +25,13 @@ file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS *.cpp)
add_library(InformationSchema STATIC ${SRC_FILES})
pch_reuse(InformationSchema)
+
+# Unity build: these schema scanners are homogeneous glue code whose per-TU
+# cost is dominated by re-parsing the same header closure once per file.
+# Batch size 0 merges all sources into a single unity TU (~10x faster than
+# compiling them individually). A new file whose file-scope symbols clash
+# inside the unity TU can opt out via SKIP_UNITY_BUILD_INCLUSION.
+if (ENABLE_UNITY_BUILD)
Review Comment:
Fixed in e1299ba40f4 — agreed, and thanks for reproducing it. The option is
now normalized to a strict ON/OFF once in `be/CMakeLists.txt`, and all three
pilot targets set `UNITY_BUILD ${DORIS_UNITY_BUILD}` unconditionally, so OFF is
an explicit OFF rather than an empty branch.
Verified on this tree with your exact repro, `-DENABLE_UNITY_BUILD=OFF
-DCMAKE_UNITY_BUILD=ON`: 28 unity TUs across InformationSchema/Service/Storage
before the change, 0 after. The ordinary `-DENABLE_UNITY_BUILD=ON` configure
still produces exactly the 6 advertised batches (1 + 1 + 4).
Normalizing has a second benefit: an empty `-DENABLE_UNITY_BUILD=` forwarded
by a script would otherwise reach `set_target_properties` as a missing value
and fail the configure with an argument-count error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]