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

Parallelize inventory rendering #28

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Parallelize inventory rendering #28

merged 2 commits into from
Sep 13, 2023

Conversation

simu
Copy link
Member

@simu simu commented Sep 12, 2023

We add rayon as a dependency and adjust the inventory rendering logic to use par_iter() to render nodeinfos in parallel.

Additionally, the PR introduces a Python classmethod Reclass.set_thread_count() which allows users to control how many threads are spawned for the Rayon default threadpool. If that method is called mutliple times, any calls except the first one will do nothing and print a diagnostic message.

Checklist

  • The PR has a meaningful title. The title will be used to auto generate the changelog
  • PR contains a single logical change (to build a better changelog).
  • Update the documentation.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency, internal
    as they show up in the changelog

@simu simu added the enhancement New feature or request label Sep 12, 2023
@simu simu force-pushed the feat/add-nodeinfo-test-cases branch from 5ea258f to dd64364 Compare September 12, 2023 13:53
Base automatically changed from feat/add-nodeinfo-test-cases to main September 12, 2023 14:17

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@simu simu force-pushed the feat/parallel-inventory branch from 1e887e3 to a9f36e2 Compare September 12, 2023 14:18
@simu simu requested a review from a team September 12, 2023 14:18
Copy link

@bastjan bastjan left a comment

Choose a reason for hiding this comment

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

This is way too easy 😊 Would be cool to have a small benchmark linked somewhere.

@simu
Copy link
Member Author

simu commented Sep 13, 2023

Would be cool to have a small benchmark linked somewhere.

I'll look into that in a follow-up

@simu simu merged commit 3d1f5f7 into main Sep 13, 2023
@simu simu deleted the feat/parallel-inventory branch September 13, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants