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

NUMA Binding Causes Performance Degradation in Rayon Work-Stealing Demo #1

Open
fkysly opened this issue Mar 1, 2025 · 0 comments
Open

Comments

@fkysly
Copy link

fkysly commented Mar 1, 2025

Environment

  • 32 cores (all physical cores + no hyperthreading)
  • 2 NUMA nodes

Issue

When binding the following Rayon workload to specific NUMA nodes, performance significantly degrades.

fn execute(pool: &ThreadPool) {
    let given: NumIter = 
        (0..NUM_ITERATIONS)
            .into_par_iter()
            .map(|_| {
                let mut result = 0;
                for i in (2..100).rev() {
                    let mut is_prime = true;
                    for j in 2..i {
                        if i % j == 0 {
                            is_prime = false;
                            break;
                        }
                    }
                    if is_prime {
                        result = (result + i as usize) % 1000;
                    }
                }
                result
            })
            .sum();
}
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

No branches or pull requests

1 participant