Skip to content

Speed up equality and hashing of named sector products - #291

Merged
mtfishman merged 1 commit into
mainfrom
mf/named-sector-equality
Oct 27, 2026
Merged

mtfishman merged 1 commit into
mainfrom
mf/named-sector-equality

Conversation

@mtfishman

Copy link
Copy Markdown
Member

Summary

Comparing or hashing a named product looped over its names, which boxes each value of the mixed-type NamedTuple, so contractions over named sectors ran up to 2× slower than over positional ones. Products with the same names now compare their arguments directly, and hash is unrolled to give the same values.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.79%. Comparing base (a569fd4) to head (2b3711f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   85.79%   85.79%   -0.01%     
==========================================
  Files          40       40              
  Lines        2845     2844       -1     
==========================================
- Hits         2441     2440       -1     
  Misses        404      404              
Flag Coverage Δ
docs 16.55% <33.33%> (-0.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mtfishman
mtfishman force-pushed the mf/named-sector-equality branch from 969788d to 2b3711f Compare October 27, 2026 02:45
@mtfishman
mtfishman enabled auto-merge (squash) October 27, 2026 02:46
@mtfishman
mtfishman merged commit ba8d7e3 into main Oct 27, 2026
19 checks passed
@mtfishman
mtfishman deleted the mf/named-sector-equality branch October 27, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant