Skip to content

Improve build memory consumption and support clang-19#432

Closed
ZacBlanco wants to merge 15 commits into
bytedance:mainfrom
ZacBlanco:clang-19
Closed

Improve build memory consumption and support clang-19#432
ZacBlanco wants to merge 15 commits into
bytedance:mainfrom
ZacBlanco:clang-19

Conversation

@ZacBlanco
Copy link
Copy Markdown
Collaborator

@ZacBlanco ZacBlanco commented Mar 27, 2026

What problem does this PR solve?

  • Fix poorly performing compilation units that cause build instability in memory-constrained environments and enable building with clang-19

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🚀 Performance improvement (optimization)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🔨 Refactoring (no logic changes)
  • 🔧 Build/CI or Infrastructure changes
  • 📝 Documentation only

Description

There are 4 sets of changes in this PR:

  1. Improve memory usage during compilation by splitting MinMaxByAggregates.cpp registration functions into two separate units instead (one for min, one for max). This helps reduce the compilation time by allowing the work to be split across two cores.
  2. Improve memory usage during compilation by reducing the number of required template instantiations inside of CastExptr-tpl.cpp. This unit is the most resource-intensive of the entire build. The changes to this file reduce the required template instantiations by about 67% which in-turn reduces compilation time by a similar margin (over 5-10 minutes now down to around 2 minutes
  3. Dependencies: Upgrade libunwind to 1.8.0->1.8.3 to fix a bug compiling on ARM. Upgrades duckdb recipe to 0.8.2->1.1.3 so we can compile it and bolt in an environment with clang 19. Moving to clang 19 is a good leap forward for the project. IMO we should aim to be building on the newest compilers as possible so that we can utilize new language features/libraries to keep bolt at the cutting-edge of performance.
  4. Adds a new devcontainer based on the existing one, but with clang-19 configured as the default compiler.

Performance Impact

  • No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).
  • Positive Impact: I have run benchmarks.
  • Negative Impact: Explained below (e.g., trade-off for correctness).

Release Note

Release Note:

Release Note:
- Upgrade DuckDB dependency to 1.1.3
- Add a clang-based devcontainer.

Checklist (For Author)

  • I have added/updated unit tests (ctest).
  • I have verified the code with local build (Release/Debug).
  • I have run clang-format / linters.
  • (Optional) I have run Sanitizers (ASAN/TSAN) locally for complex C++ changes.
  • No need to test or manual test.

Breaking Changes

  • No
  • Yes (Description: ...)

@ZacBlanco ZacBlanco marked this pull request as ready for review March 31, 2026 00:29
@ZacBlanco ZacBlanco changed the title [WIP] Improve build memory consumption and support clang-19 Improve build memory consumption and support clang-19 Mar 31, 2026
@ZacBlanco
Copy link
Copy Markdown
Collaborator Author

Closing this in favor of splitting the PR into a smaller and more managable set of changes

  1. First PR will be building with clang 19
  2. Second will be improving compilation unit time
  3. Last, add the bolt build skill

@ZacBlanco ZacBlanco closed this Mar 31, 2026
@ZacBlanco
Copy link
Copy Markdown
Collaborator Author

ZacBlanco commented Mar 31, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant