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

Removed unused array #15364

Merged
merged 2 commits into from
Nov 26, 2024
Merged

Conversation

dk2k
Copy link
Contributor

@dk2k dk2k commented Aug 22, 2024

Removed unused array

Signed-off-by: Dmitry Kryukov <[email protected]>
Copy link
Contributor

✅ Gradle check result for fd3bb33: SUCCESS

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.00%. Comparing base (ec7b652) to head (d12be33).
Report is 102 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #15364   +/-   ##
=========================================
  Coverage     72.00%   72.00%           
+ Complexity    64817    64783   -34     
=========================================
  Files          5307     5307           
  Lines        302660   302657    -3     
  Branches      43724    43723    -1     
=========================================
+ Hits         217931   217942   +11     
+ Misses        66906    66825   -81     
- Partials      17823    17890   +67     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

I wonder if this is hiding a bug and the intermediate value was supposed to be used. Maybe someone who understands agg can take a look? @Bukhtawar?

@sandeshkr419
Copy link
Contributor

sandeshkr419 commented Oct 15, 2024

I looked up the commit which added it: 2f38aeb#diff-2d2b27a2755fd2a1d43780adc7cda194f64673c4bc655c5a80c1c167cb5bd1e9 No other references of slice anywhere other than what is removed in this PR.

Also, tried finding its reference in code, looks like this got added as a dead code in the above commit.

Was this intended to be used below? Is it slow to do aggregations[index][ord]?

@dblock I don't think slowing things down would have been the intention.

@msfroh Is there an uncompleted implementation of some optimization that we may be overlooking?

@dblock
Copy link
Member

dblock commented Oct 16, 2024

@dblock I don't think slowing things down would have been the intention.

I meant that below the code does aggregations[index][ord]. This could have been the beginning of an optimization for that call.

Copy link
Contributor

✅ Gradle check result for d12be33: SUCCESS

@dblock
Copy link
Member

dblock commented Oct 16, 2024

I'm leaving this to @msfroh who understands what this code does to decide to merge/not. Thanks for your help @dk2k!

Copy link
Collaborator

@msfroh msfroh left a comment

Choose a reason for hiding this comment

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

This looks correct to me.

It feels very much like this was left over from some refactoring within the commit that introduced this array.

Specifically, I'm pretty sure that at one point line 229 (now line 225) was:

result[ord] = InternalAggregations.from(Arrays.asList(slice));

I suspect that either the original author or their reviewer objected to the number of additional objects/arrays being created, so they suggested wrapping list views over existing 2D arrays (but in column order, rather than row order).

Of course, they still left the code that created the unnecessary array -- they just let it get garbage-collected right away.

@dblock
Copy link
Member

dblock commented Oct 18, 2024

@msfroh So ok to merge as is? Hit merge?

@dbwiddis dbwiddis mentioned this pull request Oct 19, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Nov 17, 2024
@sandeshkr419 sandeshkr419 added the backport 2.x Backport to 2.x branch label Nov 26, 2024
@sandeshkr419
Copy link
Contributor

@dblock @msfroh Let's hit merge & close on this one?

@dblock dblock merged commit 5817710 into opensearch-project:main Nov 26, 2024
49 of 50 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 26, 2024
Signed-off-by: Dmitry Kryukov <[email protected]>
(cherry picked from commit 5817710)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
andrross pushed a commit that referenced this pull request Nov 27, 2024
(cherry picked from commit 5817710)

Signed-off-by: Dmitry Kryukov <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants