Skip to content

perf(encoding): implement row-based match finder for fast/dfast levels #67

@polaz

Description

@polaz

Problem

The donor enables a row-based match finder for greedy/lazy families and resolves it dynamically from parameters (see zstd_compress.c). Our encoder currently uses simple hash, dfast, and hash-chain paths only, without a row-based matcher backend.

That keeps low/mid compression levels behind donor on speed for common corpora.

Goal

Add a row-based match finder backend in Rust for Fastest/Default-oriented levels, with level-parameter routing similar to donor strategy selection.

Implementation plan

  1. Add a RowMatch backend in zstd/src/encoding/match_generator.rs with dedicated table layout and probe logic.
  2. Integrate backend selection into level parameter resolution so target levels can route to RowMatch.
  3. Preserve current backends as fallback and for levels where RowMatch is not beneficial.
  4. Add focused benchmarks for small and mid blocks where row match finder should improve throughput.
  5. Validate ratio and interoperability against C zstd on the existing bench matrix.

Acceptance criteria

  • RowMatch backend is selectable via level parameters and used in runtime for configured levels.
  • Encoder output remains valid and decompressible by C zstd and our decoder.
  • Throughput improves on target corpora at affected levels without large ratio regressions.
  • Existing matcher tests keep passing; new backend-specific tests are added.

Dependencies

Estimate

3d

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highHigh priority — core functionalityenhancementNew feature or requestperformancePerformance optimization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions