compute_large

Macro compute_large 

Source
macro_rules! compute_large {
    ($expr:expr) => { ... };
    ($pool:expr, $expr:expr) => { ... };
}
Expand description

Execute a large compute task (>1ms) on the Rayon thread pool.

This macro always offloads to Rayon as the overhead is negligible compared to the computation time.

§Example

// With thread-local context
let result = compute_large!({
    expensive_matrix_multiplication()
}).await;

// Or with explicit pool
let result = compute_large!(pool, {
    expensive_matrix_multiplication()
}).await;