MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / worker_count

Function worker_count

crates/parser/src/parallel.rs:45–52  ·  view source on GitHub ↗
(options: &ParserOptions, num_functions: usize)

Source from the content-addressed store, hash-verified

43}
44
45fn worker_count(options: &ParserOptions, num_functions: usize) -> usize {
46 let requested = options
47 .parser_threads()
48 .unwrap_or_else(|| std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1))
49 .max(1);
50
51 requested.min(num_functions).max(1)
52}
53
54fn body_len(body: &FunctionBodyInput<'_>) -> usize {
55 match body {

Callers 2

should_use_parallelFunction · 0.85
process_pendingFunction · 0.85

Calls 3

parser_threadsMethod · 0.80
mapMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected