Skip to content

Avoid hashing in operator products - #276

Merged
mtfishman merged 3 commits into
mainfrom
mf/operator-overhead
Oct 27, 2026
Merged

mtfishman merged 3 commits into
mainfrom
mf/operator-overhead

Conversation

@mtfishman

@mtfishman mtfishman commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Every product involving a NamedTensorOperator paired its output and input names by hashing them into sets and a Dict, about 1 µs and 26 allocations per product. Matching the few names by linear scans brings that under 100 ns, and tr and a few other operator functions get the same treatment.

mtfishman and others added 3 commits October 27, 2026 09:19
Operator products, `tr`, `apply`, `product` and `transpose` match the few paired names with linear scans instead of building sets and dictionaries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mtfishman
mtfishman enabled auto-merge (squash) October 27, 2026 13:31
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.60%. Comparing base (882e825) to head (c16095d).

Files with missing lines Patch % Lines
src/namedtensoroperator.jl 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
+ Coverage   82.36%   82.60%   +0.24%     
==========================================
  Files          21       21              
  Lines        1474     1466       -8     
==========================================
- Hits         1214     1211       -3     
+ Misses        260      255       -5     
Flag Coverage Δ
docs 32.70% <44.44%> (+0.13%) ⬆️

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.

@mtfishman
mtfishman merged commit 6a5bd6c into main Oct 27, 2026
18 checks passed
@mtfishman
mtfishman deleted the mf/operator-overhead branch October 27, 2026 13:55
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