# Function runTokenBenchmark

- runTokenBenchmark(
  backend: IMemoryBackend,
  config?: Partial<MemoryBenchmarkConfig>,
  ): Promise<readonly TokenBenchmarkResult[]>

  Run token savings benchmark.

  Compares baseline (all entries in context) vs optimized (only relevant entries from search) token usage.

  #### Parameters

  - backend: IMemoryBackend
  - config: Partial<MemoryBenchmarkConfig> = {}

  #### Returns Promise<readonly TokenBenchmarkResult[]>

  - Defined in packages/nexus-agents/src/benchmarks/token-benchmark.ts:63