Skip to content

Speed up DeltaBitPackDecoder #1281

@tustvold

Description

@tustvold

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The current DeltaBitPackDecoder implementation decodes each value separately with a call to BitReader::get_unaligned. This prevents it from benefiting from the vectorized unpack32 that is used by RLEDecoder, and makes for a complex inner body of the loop. It also seems to do a fair amount of memory allocation on the hot path, which is also unfortunate.

Describe the solution you'd like

The DeltaBitPackDecoder should be faster than RLEDecoder and theoretically should be even faster than PlainDecoder - the algorithm is specifically designed to vectorize well. Most of the logic to achieve this already exists, it is just a matter of hooking it up.

One small detail is unpack32 can only handle a bit width less than 32. This should be a rare degenerate case, as the format stores deltas not values, but the logic will need to fallback in such a case

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crateperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions