Performance and Caching

Performance and Caching

The data cache

Algolang caches downloaded market data locally in ~/.algolang/cache. The cache dramatically speeds up repeated backtests.

Cache management

# Show cache statistics
algo cache

# List cached entries
algo cache -l

# Flush specific entries
algo cache -F @ES*

# Flush all entries
algo cache -F

# Rebuild the cache index
algo cache -I

Parallel execution

Multi-symbol and multi-parameter runs are parallelised across CPU cores:

# Run with 8 parallel workers
algo run --strategy kbt --symbols <all --parallel 8

# Sequential execution (useful for debugging)
algo run --strategy kbt --symbols @ES --parallel 0

Test deduplication

During optimisation, Algolang automatically detects and skips parameter combinations that would produce identical results, reducing total test count.

Profiling

Generate CPU and heap profiles for performance analysis:

algo run --strategy kbt --symbols @ES --profile ./prof

This creates CPU and heap profile files that can be analysed with go tool pprof.