Skip to content

v0.3.2

Choose a tag to compare

@peterc peterc released this 21 Mar 17:03
· 31 commits to main since this release

Performance optimizations

Major performance improvements across the entire encode/decode pipeline, primarily from contributions by @paracycle:

  • Replaced float matrix-multiply DCT with integer-scaled AAN DCT (IJG reference implementation)
  • Fixed-point integer arithmetic for color space conversion
  • Eliminated hundreds of thousands of short-lived object allocations per encode
  • Unrolled inner loops in DCT, block extraction, and block writing

Benchmarks (1024x1024, Ruby 4.0.2 + YJIT):

Operation v0.3.1 v0.3.2 Speedup
Encode (color, q85) ~0.47s ~0.16s 2.9x
Decode (baseline) ~0.63s ~0.14s 4.6x
Decode (progressive) ~0.70s ~0.18s 3.9x

No public API changes.