Skip to content

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented Jun 13, 2025

No description provided.

@wendigo wendigo requested review from Copilot and martint June 13, 2025 11:14
Copilot

This comment was marked as outdated.

@wendigo wendigo requested a review from Copilot June 13, 2025 11:28
Copilot

This comment was marked as outdated.

@wendigo wendigo changed the title Optimize succinctBytes Optimize succinctBytes, succinctDuration Jun 13, 2025
@wendigo wendigo requested a review from Copilot June 13, 2025 11:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the conversion of time durations and data sizes by updating the succinct methods in Duration and DataSize.

  • Improve succinctDuration in Duration.java to dynamically select the most succinct time unit using a helper method.
  • Update DataSize.java to leverage a static succinctUnit method and add an early return in to(Unit) for performance gains.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/main/java/io/airlift/units/Duration.java Updates conversion logic and introduces conversion helpers to optimize succinctDuration.
src/main/java/io/airlift/units/DataSize.java Refactors succinct methods to use static unit selection and optimizes conversion checks.

@wendigo wendigo force-pushed the serafin/optimize-succinct-bytes branch from 8a8001f to a34e15c Compare June 13, 2025 11:56
@wendigo wendigo force-pushed the serafin/optimize-succinct-bytes branch from a34e15c to c9920e3 Compare June 13, 2025 11:57
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.

1 participant