feat(build): make TBB dependency configurable - #254
Conversation
|
Before starting the review, I’d like to better understand the specific motivation behind this PR — for example, which platform or downstream project is unable to use TBB, and what the performance trade-offs are when disabling it. BTW, the current CI also doesn’t seem to cover the |
The motivation is not platform compatibility. We integrate Paimon C++ as a DSO to isolate its large dependency graph from the existing service. However, both the service and the DSO bring their own TBB runtime and worker pool, which can cause thread oversubscription. PAIMON_USE_TBB=OFF allows the DSO to avoid introducing the second TBB runtime. You are also right that CI currently does not cover PAIMON_USE_TBB=OFF; I will add a dedicated non-TBB build/test configuration. |
|
@gripleaf Thanks for the clarification. If the main concern is that the Paimon DSO embeds a second TBB runtime, could this be addressed by building Paimon against the same shared TBB used by the host service, for example with: -DTBB_SOURCE=SYSTEM -DTBB_ROOT=/path/to/the/host/tbb/prefixThe existing dependency resolver already supports Also, Paimon currently appears to use TBB only for |
Purpose
Linked issue: N/A
Make the oneTBB dependency optional through the
PAIMON_USE_TBBCMake option.PAIMON_USE_TBB=ONby default to preserve existing behavior.PAIMON_USE_TBB=OFF.concurrent_hash_map.hexposes the TBB implementation when TBB is enabled and includesstd_concurrent_hash_map.hotherwise.concurrent_bounded_queue.hexposes the TBB implementation when TBB is enabled and includesstd_concurrent_bounded_queue.hotherwise.ConcurrentBoundedQueuemethod names and relevant type aliases compatible with the correspondingtbb::concurrent_bounded_queueAPI.Tests
paimon_objlibwithPAIMON_USE_TBB=ON.paimon_objlibwithPAIMON_USE_TBB=OFF.git diff --check.The complete unit and integration test suites were not run.
API and Format
This change does not affect the public API under
include/paimon/.It does not change the storage format or protocol.
The new concurrent container implementations are internal utilities under
src/paimon/common/utils/.Documentation
Updated
docs/source/building.rstto document:PAIMON_USE_TBBCMake option.TBB_SOURCEonly being considered when TBB is enabled.Generative AI tooling
Generated-by: OpenAI Codex (GPT-5)