Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce interval creation cost for segment cost computation #12670

Merged

Conversation

AmatyaAvadhanula
Copy link
Contributor

@AmatyaAvadhanula AmatyaAvadhanula commented Jun 17, 2022

Optimizes segment cost computation time by reducing time taken for interval creation

image

It is evident that a lot of time is taken for interval creation when it can simply be stored, but it may adversely affect memory.
This PR does the following

  1. Store segment interval instead of creating it each time from primitives
  2. Reduce memory overhead of storing intervals by interning them. The set of intervals for segments is low in cardinality.

Key changed/added classes in this PR
  • SegmentId

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Thanks for improving this, @AmatyaAvadhanula!

+1 after CI passes

@kfaraz
Copy link
Contributor

kfaraz commented Jun 20, 2022

There are failing tests: SegmentLoadDropHandlerTest.

@kfaraz
Copy link
Contributor

kfaraz commented Jun 21, 2022

Merging as failure seems unrelated.

@kfaraz kfaraz merged commit eccdec9 into apache:master Jun 21, 2022
@abhishekagarwal87 abhishekagarwal87 added this to the 24.0.0 milestone Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants