Skip to content

PERF: Set the default threader to Pool#305

Merged
N-Dekker merged 1 commit into
InsightSoftwareConsortium:release-5.4from
thewtex:default-thread-pool
Jun 29, 2026
Merged

PERF: Set the default threader to Pool#305
N-Dekker merged 1 commit into
InsightSoftwareConsortium:release-5.4from
thewtex:default-thread-pool

Conversation

@thewtex

@thewtex thewtex commented Jun 25, 2026

Copy link
Copy Markdown
Member

Continue to enable TBB support, but change the default threader to Pool.

TBB can exhibit decreased performance in some cases, and it seems that more refinement is needed with the number of work units, etc.

See:

https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736
InsightSoftwareConsortium/ITKElastix#391

This setting is consistent with the libitk conda-forge build configuration.

Continue to enable TBB support, but change the default threader to Pool.

TBB can exhibit decreased performance in some cases, and it seems that
more refinement is needed with the number of work units, etc.

See:

  https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736
  InsightSoftwareConsortium/ITKElastix#391

This setting is consistent with the libitk conda-forge build configuration.

@blowekamp blowekamp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Also note that the Pool is the default threader from the new conda-forge native ITK python package ( but Elastix is not enabled there yet).

@N-Dekker N-Dekker left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 Cool, thanks Matt!

@N-Dekker

Copy link
Copy Markdown

I noticed that four different syntaxes are being used to pass a CMake option, depending on context and platform:

--config.setting=cmake.define.ITK_DEFAULT_THREADER:STRING=Pool \
-DITK_DEFAULT_THREADER:STRING=Pool \
"-DITK_DEFAULT_THREADER:STRING=Pool",
-DITK_DEFAULT_THREADER:STRING=Pool

Just wondering, would there be a way to share the code (or at least share the CMake options) between the platforms?

Not an issue, just something I'm wondering 🤓

@N-Dekker N-Dekker merged commit 2f40f4b into InsightSoftwareConsortium:release-5.4 Jun 29, 2026
1 check passed
@thewtex

thewtex commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@N-Dekker there is refactoring as Python scripts that may provide more unification.

@thewtex thewtex deleted the default-thread-pool branch July 2, 2026 01:59
@N-Dekker

N-Dekker commented Jul 2, 2026

Copy link
Copy Markdown

@thewtex:

there is refactoring as Python scripts that may provide more unification.

@thewtex

thewtex commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Or some variant of it.

@CavRiley

CavRiley commented Jul 2, 2026

Copy link
Copy Markdown

I can break that PR into more digestible chunks if that's preferred.

@thewtex

thewtex commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@CavRiley yes, smaller steps will help!

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.

5 participants