Parallelism

Mutagoph supports multiple parallelism levels to balance speed and resource usage.

Static Levels

Level Workers Use Case
low 1 Minimal resource usage, watch mode
medium NumCPU / 2 Balanced resource usage
high NumCPU Maximum throughput
mutilated NumCPU * 2 Extreme parallelism
mutagoph run --parallelism high

Dynamic Mode

Dynamic mode (default) starts with minimal workers and spawns additional workers when mutations take longer than 1 second.

mutagoph run --parallelism dynamic --dynamic-level balanced

Dynamic Sub-levels

Sub-level Initial Workers Max Workers
minimal 1 NumCPU / 4
balanced NumCPU / 4 NumCPU * 2
comprehensive NumCPU / 2 NumCPU * 3
mutilated NumCPU NumCPU * 4

How It Works

  1. Starts with initial workers based on sub-level
  2. Monitors mutation execution time
  3. If mutations take > 1 second and work is queued:
    • Spawns additional worker
    • Waits 1 second before spawning more
  4. Continues until max workers reached

This ensures:

  • Fast mutations run quickly with minimal resources
  • Slow mutations don’t block the queue
  • Resource usage scales with workload

Choosing Parallelism

Scenario Recommended
Development machine dynamic (balanced)
CI with shared resources low or medium
Dedicated CI runner high
Maximum speed mutilated
Watch mode low

Resource Considerations

Higher parallelism uses more:

  • CPU cores
  • Memory (each worker loads test binaries)
  • Disk I/O (compilation and test execution)

Monitor your system resources and adjust accordingly.