Skip to content

perf: inline int.from_bytes in UUID conversion functions#202

Closed
bdraco wants to merge 1 commit into
mainfrom
optimize-uuid-inline-from-bytes
Closed

perf: inline int.from_bytes in UUID conversion functions#202
bdraco wants to merge 1 commit into
mainfrom
optimize-uuid-inline-from-bytes

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Mar 15, 2026

Summary

  • Replace partial(int.from_bytes, byteorder="little") wrapper calls with direct int.from_bytes(..., byteorder="little") in _uint128_bytes_as_uuid, _uint16_bytes_as_uuid, and _uint32_bytes_as_uuid
  • Remove the now-unused from_bytes_little definition from gap.py and its declaration from gap.pxd
  • Eliminates ~0.025 us partial call overhead per LRU cache miss

Test plan

  • All 73 existing tests pass
  • Pre-commit hooks pass (ruff, mypy, codespell, etc.)

Replace partial(int.from_bytes) wrapper with direct calls
to eliminate ~0.025 us partial call overhead per cache miss.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 15, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing optimize-uuid-inline-from-bytes (79b2465) with main (7a74ee9)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7a74ee9) to head (79b2465).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #202   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          255       254    -1     
  Branches        38        38           
=========================================
- Hits           255       254    -1     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bdraco bdraco closed this Mar 15, 2026
@bdraco bdraco deleted the optimize-uuid-inline-from-bytes branch March 15, 2026 04:30
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