Raxol.Performance.CacheConfig (Raxol v2.0.1)

View Source

Optimized cache configuration for Raxol performance subsystem.

This module provides centralized configuration for all cache parameters, optimized based on profiling data and usage patterns.

Cache Size Optimization

Cache sizes are calculated based on:

  • Working set analysis from production data
  • Memory constraints (target <5MB total)
  • Hit rate optimization (target >85%)
  • Access frequency patterns

Adaptive Tuning

The configuration supports runtime adjustment based on:

  • Available system memory
  • Application workload
  • Cache hit rates
  • Memory pressure

Summary

Functions

Apply cache configuration to ETS Cache Manager.

Get optimized cache configuration based on system profile.

Calculate optimal entry size limits based on profile.

Get memory budget for caches in bytes.

Get recommended configuration based on system analysis.

Functions

apply_config(profile \\ :balanced)

Apply cache configuration to ETS Cache Manager.

get_config(profile \\ :balanced)

@spec get_config(atom()) :: map()

Get optimized cache configuration based on system profile.

Profiles:

  • :minimal - Minimum memory usage, suitable for constrained environments
  • :balanced - Default balanced configuration
  • :performance - Maximum performance, higher memory usage
  • :adaptive - Dynamically adjust based on runtime metrics

get_entry_limits(profile)

Calculate optimal entry size limits based on profile.

memory_budget(profile)

@spec memory_budget(atom()) :: pos_integer()

Get memory budget for caches in bytes.

recommend_profile()

Get recommended configuration based on system analysis.