Skip to content

Conversation

@derek-miller
Copy link
Contributor

@derek-miller derek-miller commented Jan 27, 2026

This pull request includes the following changes:

  • Introduce _compat module:
    A unified compatibility layer is added for bitwise operations. This detects and uses native bitwise support or falls back to custom implementations, enhancing maintainability, performance, and cross-version compatibility for bit16, bit32, and bit64 modules.

  • Refactor bitwise modules:
    The bit16, bit32, and bit64 modules are refactored to leverage the _compat module. Operations such as shifts, byte conversions, and others are now unified under a central compatibility logic.

  • Add benchmarking infrastructure:

    • Introduced bitn.utils.benchmark module with benchmark_op() utility functions.
    • Added benchmark() functions to bit16, bit32, and bit64.
    • Included a run_benchmarks.sh script to execute benchmarks with make bench and make bench-<module> targets.
    • Provided detailed benchmark documentation in README.md and CLAUDE.md.
    • Benchmarks cover operations like bitwise shifts, rotations, arithmetic, and byte conversions with 100k iterations per operation.

- Add bitn.utils.benchmark module with benchmark_op() utility
- Add benchmark() function to bit16, bit32, and bit64 modules
- Add run_benchmarks.sh script for running benchmarks
- Add make bench and make bench-<module> targets
- Update README.md and CLAUDE.md with benchmarking documentation

Each module benchmarks bitwise operations, shifts, rotates, arithmetic,
and byte conversions with 100K iterations per operation.
…d optimize bit16, bit32, and bit64 modules.

- Add `_compat` module to detect and leverage native bitwise operations or fallback implementations.
- Refactor bit16, bit32, and bit64 modules to utilize `_compat` for enhanced performance, maintainability, and cross-version support.
- Consolidate all bitwise operations, shifts, and byte conversions under unified compatibility logic.
@derek-miller derek-miller merged commit cebcdcb into main Jan 27, 2026
8 checks passed
@derek-miller derek-miller deleted the optimize branch January 27, 2026 17:35
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.

2 participants