Skip to content

Conversation

@koushiro
Copy link
Owner

@koushiro koushiro commented Feb 8, 2026

Which issue does this PR close?

Closes #.

Rationale for this change

The existing dynamic Family implementation is flexible but incurs hash lookup overhead on hot update paths. For fixed-cardinality label domains, we need a faster indexed path while keeping encoding behavior and API ergonomics consistent.

What changes are included in this PR?

  • Added metrics::family::IndexedFamily for fixed-cardinality indexed storage.
  • Added metrics::family::LabelIndexMapping trait and LabelIndex token for reusable indexed lookups.
  • Split family module into dynamic and indexed, and re-exported public types from metrics::family.
  • Added #[derive(LabelIndexMapping)] in fastmetrics-derive for unit enums and named structs.
  • Added trybuild coverage for LabelIndexMapping pass/fail cases and updated related UI tests.
  • Updated family benchmarks to include fastmetrics_indexed cases.
  • Synced latest just bench family results into benchmarks/README.md.

Are there any user-facing changes?

Yes.

  • New public APIs: IndexedFamily, LabelIndex, and LabelIndexMapping.
  • New derive macro: fastmetrics_derive::LabelIndexMapping.
  • Benchmark documentation updated with new family benchmark numbers.

AI usage statement

This change was implemented with assistance from OpenAI Codex using model gpt-5.3-codex with reasoning effort xhigh, and reviewed/edited before commit.

# Which issue does this PR close?

Closes #.

# Rationale for this change

The existing dynamic `Family` implementation is flexible but incurs hash lookup overhead on hot update paths. For fixed-cardinality label domains, we need a faster indexed path while keeping encoding behavior and API ergonomics consistent.

# What changes are included in this PR?

- Added `metrics::family::IndexedFamily` for fixed-cardinality indexed storage.
- Added `metrics::family::LabelIndexMapping` trait and `LabelIndex` token for reusable indexed lookups.
- Split family module into `dynamic` and `indexed`, and re-exported public types from `metrics::family`.
- Added `#[derive(LabelIndexMapping)]` in `fastmetrics-derive` for unit enums and named structs.
- Added trybuild coverage for `LabelIndexMapping` pass/fail cases and updated related UI tests.
- Updated family benchmarks to include `fastmetrics_indexed` cases.
- Synced latest `just bench family` results into `benchmarks/README.md`.

# Are there any user-facing changes?

Yes.
- New public APIs: `IndexedFamily`, `LabelIndex`, and `LabelIndexMapping`.
- New derive macro: `fastmetrics_derive::LabelIndexMapping`.
- Benchmark documentation updated with new family benchmark numbers.

# AI usage statement

This change was implemented with assistance from OpenAI Codex using model `gpt-5.3-codex` with reasoning effort `xhigh`, and reviewed/edited before commit.
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. release-note/feat The PR has a title that begins with "feat" or implements a new feature labels Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/feat The PR has a title that begins with "feat" or implements a new feature size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant