rspack_core 0.100.3

rspack core
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::sync::Once;

static RAYON_FOR_CODSPEED: Once = Once::new();

/// Make Rayon use the benchmark thread as worker 0 so CodSpeed attributes
/// rayon work to the measured parent function.
pub fn configure_rayon_current_thread_for_codspeed() {
  RAYON_FOR_CODSPEED.call_once(|| {
    rayon::ThreadPoolBuilder::new()
      .use_current_thread()
      .build_global()
      .expect("rayon global thread pool should be configured before rayon is used");
  });
}