Skip to content

GH-3461: Avoid unnecessary debug logging overhead in record write hot path#3462

Merged
Fokko merged 1 commit intoapache:masterfrom
arouel:avoid-long-boxing-on-write
Apr 21, 2026
Merged

GH-3461: Avoid unnecessary debug logging overhead in record write hot path#3462
Fokko merged 1 commit intoapache:masterfrom
arouel:avoid-long-boxing-on-write

Conversation

@arouel
Copy link
Copy Markdown
Contributor

@arouel arouel commented Apr 2, 2026

Rationale for this change

InternalParquetRecordWriter.checkBlockSizeReached runs in a hot path, and we observed unnecessary overhead from debug log argument handling when debug logging is disabled. At high throughput (millions of records), this avoidable work can accumulate and impact write efficiency.

What changes are included in this PR?

This PR adds LOG.isDebugEnabled() guards around debug log statements in InternalParquetRecordWriter.checkBlockSizeReached.

Are these changes tested?

No new tests were added because the change is non-functional and limited to logging guards. Existing writer tests continue to cover the affected code paths functionally, and behavior is expected to remain unchanged.

Are there any user-facing changes?

There are no user-facing behavior changes. The expected impact is reduced internal overhead in high-volume write scenarios when debug logging is not enabled.

Closes #3461

Copy link
Copy Markdown
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for cleaning this up @arouel

@Fokko Fokko merged commit 48e2dbd into apache:master Apr 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid unnecessary debug logging overhead in record write hot path

3 participants