Skip to content

Commit 01f3a7b

Browse files
committed
feat: get_thread_count
1 parent de538cf commit 01f3a7b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

frameworks/Rust/hyperlane/src/utils.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
use super::*;
22

33
pub fn get_thread_count() -> usize {
4-
let cpu_count: usize = num_cpus::get_physical();
5-
let total_threads: usize = num_cpus::get();
6-
let threads_per_cpu: usize = if cpu_count > 0 {
7-
total_threads / cpu_count
8-
} else {
9-
1
10-
};
11-
cpu_count * threads_per_cpu
4+
num_cpus::get().max(1)
125
}
136

147
pub fn escape_html(input: &str) -> String {

0 commit comments

Comments
 (0)