Skip to content

Add backend-2fa Load Test with cargo bench #835

Description

@success-OG

Background:
The 2FA backend has no performance benchmarks. There is no baseline for TOTP verification throughput, making it impossible to detect performance regressions introduced by future changes.

Problem:
No benchmarks exist for the backend 2FA hot paths.

What "done" looks like:

  • A benches/totp_verification.rs benchmark measures TOTP token generation and verification throughput.
  • A benches/rate_limiter.rs benchmark measures InMemoryRateLimiter::check under concurrent load.
  • Benchmarks run via cargo bench and output ns/iter results.
  • Baseline numbers are documented in docs/development.md.

Implementation guidelines:

  • Key files: backend-2fa/Cargo.toml (add bench targets), backend-2fa/benches/.
  • Use the criterion crate with an exact pinned version.
  • Benchmarks must not require a running database.

PR must include:

  • Two benchmark files
  • criterion dev-dependency
  • Baseline numbers in development.md
  • cargo bench passing

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions