Skip to content

Add speed benchmarks to CI #796

@abrookins

Description

@abrookins

Add performance benchmarks to CI to track model instantiation speed and prevent performance regressions.

Context

From discussion in #640, there's concern about the performance overhead of HashModel/JsonModel instantiation compared to plain Pydantic BaseModel. While some overhead is expected due to Redis OM's additional functionality (metaclass processing, PK generation, field validation), we should track this to:

  1. Prevent performance regressions
  2. Measure improvements from optimizations
  3. Provide visibility into instantiation costs

Proposed Benchmarks

  • Model instantiation timing (HashModel, JsonModel, EmbeddedJsonModel vs BaseModel)
  • Bulk save operations
  • Query performance (find, filter operations)

Implementation Options

  • Use pytest-benchmark for benchmark tests
  • Run benchmarks in CI and report results
  • Consider using GitHub Actions for benchmark tracking (e.g., github-action-benchmark)

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions