Skip to content

[Minor] Use std::thread::available_parallelism instead of num_cpus - #13579

Merged
Dandandan merged 6 commits into
apache:mainfrom
Dandandan:remove_num_cpus
Nov 28, 2024
Merged

[Minor] Use std::thread::available_parallelism instead of num_cpus#13579
Dandandan merged 6 commits into
apache:mainfrom
Dandandan:remove_num_cpus

Conversation

@Dandandan

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Removes num_cpus to reduce number of dependencies.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@DandandanDandandan changed the title [Minor] Use std::thread::available_parallelism[Minor] Use std::thread::available_parallelism instead of num_cpusNov 27, 2024
@github-actionsgithub-actionsBot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) common Related to common crate labels Nov 27, 2024

@compheadcomphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm thanks @Dandandan
Wondering should we factor out the

available_parallelism()
.unwrap_or(NonZero::new(1).unwrap())
.get()

into separate concise method?

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

Labels

commonRelated to common cratecoreCore DataFusion cratesqllogictestSQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Dandandan@comphead