apache / apache/arrow-rs

Avoid unnecessary buffer zero-fill in Snappy decompression

Open Beginner friendly
#9,579 0 comments 0 reactions 0 assignees View on GitHub
parquet performance
Dominant language
Rust
Stars
3.6k
Forks
1.3k
Avg merge
2d 14h
Merged PRs (30d)
167

Description

## Description

Currently, Snappy decompression uses `resize(len, 0)` which zero-fills the buffer before writing. Since Snappy will overwrite the entire region on success, this memset is wasted work.

## Proposed Change

Write directly into spare capacity using `reserve()` + `spare_capacity_mut()` + `set_len()`, eliminating the unnecessary zero-fill.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Contributor guide

Open the contributing guide

Research direction

Locate the Snappy decompression implementation in the Rust source and inspect how the output buffer is currently resized and written. Change the buffer handling to use spare capacity as described, then verify that the existing decompression behavior and tests still pass without the zero-fill.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering, performance
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.