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

rayon parallel PoW grinding for CpuBackend #826

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Okm165
Copy link

@Okm165 Okm165 commented Sep 8, 2024

Parallelized Proof-of-Work Grinding Implementation

This PR introduces enhancement to the proof-of-work (PoW) grinding process in CpuBackend by leveraging the rayon crate for parallel computation when the parallel feature is enabled.

Key changes include:

  • Refactored the nonce-checking logic into a closure to reduce code duplication.
  • Implemented conditional compilation to select between sequential and parallel iterators (find() vs find_any()).
  • Integrated parallelism via rayon::prelude::* for improved performance in multi-threaded environments.

This change aims to enhance speed in PoW computation.


This change is Reviewable

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.

1 participant