Skip to content

Release 0.9.2

Choose a tag to compare

@OutSquareCapital OutSquareCapital released this 16 Jan 01:46
· 1856 commits to master since this release

Release 0.9.2

πŸš€ pyochain 0.9.2 β€” Release Notes

Date: 2026-01-16 πŸ“…

πŸ†• Highlights

This release focuses on performance improvements through Rust migration and minor fixes to typing and keyword argument handling.:

  • Rust Migration: Moved 10 core iterator methods to Rust β€” Up to 3.09x faster for comparison operations, 2.39x faster for sorting checks
  • Type Safety Improvements: Enhanced Result.flatten() type inference for better IDE support and fewer false positives
  • Code Quality: Improved docstrings, internal tooling, and API consistency across Rust implementations
  • Kwargs bugfix: Fixed misalignment of keyword arguments in methods like map_or_else between {Ok, Some} and {Err, None} variants

πŸ”₯ Performance Improvements

Rust Migration: Iterator Comparison & Sorting Methods

Migrated 10 PyIterator methods from Python to Rust:

  • Lazy comparison operators: eq, ne, lt, gt, le, ge
  • Sorting checks: is_sorted, is_sorted_by
  • Functional operations: try_fold, try_reduce

This migration provides a median speedup of +105% across all methods, with marked improvements on comparisons and sorting operations.

Details

Performance results across 2,500 runs with 10 function calls each:

┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Category     ┃ Operation                        ┃ Runs ┃ New (ΞΌs, median) ┃ Old (ΞΌs, median) ┃ Speedup ┃
┑━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
β”‚ eq_test      β”‚ comp_eq                          β”‚ 2500 β”‚            349.6 β”‚           1080.9 β”‚   3.09x β”‚
β”‚ comparison   β”‚ comp_lt                          β”‚ 2500 β”‚            368.5 β”‚           1105.3 β”‚    3.0x β”‚
β”‚ comparison   β”‚ comp_ne                          β”‚ 2500 β”‚            366.1 β”‚           1090.3 β”‚   2.98x β”‚
β”‚ comparison   β”‚ comp_gt                          β”‚ 2500 β”‚           368.35 β”‚           1096.0 β”‚   2.98x β”‚
β”‚ comparison   β”‚ comp_ge                          β”‚ 2500 β”‚            368.3 β”‚          1095.85 β”‚   2.98x β”‚
β”‚ comparison   β”‚ comp_le                          β”‚ 2500 β”‚           367.55 β”‚           1082.5 β”‚   2.95x β”‚
β”‚ is_sorted    β”‚ is_sorted_asc_exit100            β”‚ 2500 β”‚            146.6 β”‚            349.7 β”‚   2.39x β”‚
β”‚ is_sorted    β”‚ is_sorted_desc_exit100           β”‚ 2500 β”‚            151.7 β”‚            358.5 β”‚   2.36x β”‚
β”‚ is_sorted    β”‚ is_sorted_asc_strict_exit100     β”‚ 2500 β”‚            150.0 β”‚            350.2 β”‚   2.33x β”‚
β”‚ is_sorted    β”‚ is_sorted_desc_exit50            β”‚ 2500 β”‚             81.7 β”‚            188.6 β”‚   2.31x β”‚
β”‚ is_sorted    β”‚ is_sorted_asc_exit50             β”‚ 2500 β”‚             78.4 β”‚            180.2 β”‚    2.3x β”‚
β”‚ is_sorted    β”‚ is_sorted_asc_strict_exit50      β”‚ 2500 β”‚             79.7 β”‚           182.25 β”‚   2.29x β”‚
β”‚ is_sorted    β”‚ is_sorted_desc_strict_exit100    β”‚ 2500 β”‚            150.9 β”‚            342.9 β”‚   2.27x β”‚
β”‚ is_sorted    β”‚ is_sorted_desc_strict_exit50     β”‚ 2500 β”‚             82.3 β”‚            181.5 β”‚   2.21x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_desc_exit50         β”‚ 2500 β”‚            376.7 β”‚           711.45 β”‚   1.89x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_desc_exit100        β”‚ 2500 β”‚            744.6 β”‚          1399.75 β”‚   1.88x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_asc_strict_exit50   β”‚ 2500 β”‚            379.6 β”‚            712.6 β”‚   1.88x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_asc_strict_exit100  β”‚ 2500 β”‚            755.8 β”‚           1402.0 β”‚   1.85x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_asc_exit100         β”‚ 2500 β”‚            759.9 β”‚          1368.25 β”‚    1.8x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_asc_exit50          β”‚ 2500 β”‚            387.5 β”‚            686.4 β”‚   1.77x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_desc_strict_exit50  β”‚ 2500 β”‚            386.0 β”‚            678.1 β”‚   1.76x β”‚
β”‚ is_sorted_by β”‚ is_sorted_by_desc_strict_exit100 β”‚ 2500 β”‚            764.3 β”‚           1341.2 β”‚   1.75x β”‚
β”‚ try_reduce   β”‚ try_reduce                       β”‚ 2500 β”‚            287.8 β”‚            418.8 β”‚   1.46x β”‚
β”‚ try_fold     β”‚ try_fold                         β”‚ 2500 β”‚            293.0 β”‚            418.7 β”‚   1.43x β”‚
β”‚ try_fold     β”‚ try_fold_conditional_logic       β”‚ 2500 β”‚            643.0 β”‚            895.8 β”‚   1.39x β”‚
β”‚ try_reduce   β”‚ try_reduce_conditional_logic     β”‚ 2500 β”‚            650.0 β”‚            888.6 β”‚   1.37x β”‚
β”‚ try_fold     β”‚ try_fold_string_accumulation     β”‚ 2500 β”‚            460.5 β”‚            595.6 β”‚   1.29x β”‚
β”‚ try_reduce   β”‚ try_reduce_string_accumulation   β”‚ 2500 β”‚            452.8 β”‚            585.0 β”‚   1.29x β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Median speedup: 2.05x
New wins: 28/28