Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create threadPool with max threads equal to CPU cores #43

Open
iNewLegend opened this issue May 23, 2024 · 0 comments
Open

Create threadPool with max threads equal to CPU cores #43

iNewLegend opened this issue May 23, 2024 · 0 comments
Labels
todo has to be done

Comments

@iNewLegend
Copy link
Member

Title: Create threadPool with max threads equal to CPU cores

Description:
There is a TODO comment in the packages/zenflux-cli/src/core/typescript.ts file that suggests creating a thread pool with a maximum number of threads equal to the number of CPU cores. This enhancement aims to optimize the threading model by avoiding the creation of an excessive number of threads, which can lead to performance degradation.

Location in Code:

// TODO: Avoid this, create threadPool with max threads = cpu cores.

Proposed Solution:
Implement a thread pool that dynamically adjusts the number of threads based on the available CPU cores. This can be achieved using Node.js's os module to determine the number of CPU cores and then configuring the thread pool accordingly.

Benefits:

  • Improved performance by efficiently utilizing CPU resources.
  • Reduced overhead from managing too many threads.
  • Better scalability and resource management.

Priority: Medium

This issue will help track the progress of this enhancement and ensure it is addressed in a future update.

Originally posted by @codiumai-pr-agent-pro[bot] in #35 (comment)

@iNewLegend iNewLegend added the todo has to be done label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo has to be done
Projects
None yet
Development

No branches or pull requests

1 participant