# `Sinter.Performance`
[🔗](https://github.com/nshkrdotcom/sinter/blob/v0.3.1/lib/sinter/performance.ex#L1)

Performance monitoring and optimization utilities for Sinter.

This module provides tools for monitoring validation performance and
optimizing schemas for high-throughput scenarios common in DSPEx.

# `analyze_memory_usage`

```elixir
@spec analyze_memory_usage(Sinter.Schema.t(), [map()]) :: map()
```

Analyzes memory usage during validation.

Useful for optimizing memory consumption in long-running DSPEx programs.

## Parameters

  * `schema` - The schema to analyze
  * `dataset` - Sample data for analysis

## Returns

  * Map with memory usage statistics

# `benchmark_validation`

```elixir
@spec benchmark_validation(Sinter.Schema.t(), [map()], keyword()) :: map()
```

Benchmarks validation performance for a schema and dataset.

Returns timing information useful for optimizing DSPEx programs.

## Parameters

  * `schema` - The schema to benchmark
  * `dataset` - Sample data for benchmarking
  * `opts` - Benchmark options

## Options

  * `:iterations` - Number of iterations to run (default: 1000)
  * `:warmup` - Number of warmup iterations (default: 100)

## Returns

  * Map with timing statistics

## Examples

    iex> schema = Sinter.Schema.define([{:id, :integer, [required: true]}])
    iex> dataset = [%{"id" => 1}, %{"id" => 2}, %{"id" => 3}]
    iex> stats = Sinter.Performance.benchmark_validation(schema, dataset)
    iex> is_number(stats.avg_time_microseconds)
    true

# `profile_schema_complexity`

```elixir
@spec profile_schema_complexity(Sinter.Schema.t()) :: map()
```

Profiles schema complexity for optimization recommendations.

Analyzes a schema to identify potential performance bottlenecks and
suggests optimizations for DSPEx usage.

## Parameters

  * `schema` - The schema to profile

## Returns

  * Map with complexity analysis and optimization suggestions

---

*Consult [api-reference.md](api-reference.md) for complete listing*
