Skip to content

Limits for available CPU cores during importing - #97

Merged
lisaSW merged 3 commits into
developfrom
limit-core-usage
Apr 1, 2026
Merged

Limits for available CPU cores during importing#97
lisaSW merged 3 commits into
developfrom
limit-core-usage

Conversation

@pawelfloryan

Copy link
Copy Markdown
Contributor

Added the following limits for logical CPU cores usage during importing:

  • for systems with more than 3 cores: all cores - 2
  • with 3 cores: all cores - 1
  • with less than 3 cores: all cores

Also added tests for new functions.

Also added tests for new functions used

@joelillo joelillo 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.

Looking good! Just one small cleanup comment

Comment thread cmd/import.go Outdated
// Get the amount of logical cores available without the program interrupting other system processes.
// At the time of writing the recommended minimal cpu count is 3 so for systems with less let all be available.
func GetAvailableCores(coresNum int) int {
if coresNum > 2 {

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.

Slightly cleaner logic for this nested block:

if coresNum == 3 {
coresNum--
} else if coresNum > 3 {
coresNum -= 2
}

@lisaSW
lisaSW merged commit b93e6c7 into develop Apr 1, 2026
6 checks passed
@lisaSW
lisaSW deleted the limit-core-usage branch April 1, 2026 17:18
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.

3 participants