Skip to content

Release 1.2.0

Choose a tag to compare

@behdad behdad released this 13 Feb 01:08
· 29 commits to master since this release

New Features

Array Overlap Optimization

When extending arrays, packtab now automatically detects and merges common boundary runs where all overlapping elements share the same value, reducing total array size.

Example:

Existing: [1, 2, 7, 7, 7]  (3 trailing 7s)
New:      [7, 7, 8, 9]      (2 leading 7s)
Result:   [1, 2, 7, 7, 7, 8, 9]  (saved 2 elements)

Improvements

  • ~60 bytes saved on HarfBuzz UCD tables
  • O(N+M) linear scan - very cheap overhead
  • Automatic - only triggers when beneficial (matching boundary values)
  • Universal - works across all generated arrays

Technical Details

The optimization performs two linear scans from array boundaries:

  1. Count trailing run of value V in existing array
  2. Count leading run of value V in new data
  3. Overlap by min(trailing, leading) elements

Since the operation is done during array extension anyway, the overhead is negligible while providing measurable space savings on real-world data.

Installation

pip install --upgrade packtab