reddb-io-engine 1.26.8

Shared RedDB query execution and storage primitives for native and WebAssembly runtimes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Host execution capabilities used by canonical collection scans.

/// Native hosts retain the existing core-count threshold. Browser Workers run
/// scans serially; Rust thread spawning is unavailable on wasm32-unknown-unknown.
pub fn should_parallelize() -> bool {
    #[cfg(not(target_arch = "wasm32"))]
    {
        std::thread::available_parallelism()
            .map(|cores| cores.get() > 1)
            .unwrap_or(false)
    }
    #[cfg(target_arch = "wasm32")]
    {
        false
    }
}