Skip to content

Conversation

@original-brownbear
Copy link
Contributor

The single element close calls go through a very inefficient path that includes creating
a one element list.
releaseOnce is only with a single non-null input in production in two spots so no need for
varargs and any complexity here.
ReleasableBytesStreamOutput does not require any releaseOnce wrapping because we already have
that kind of logic implemented in org.elasticsearch.common.util.AbstractArray (which we were
wrapping here) already.

The single element `close` calls go through a very inefficient path that includes creating
a one element list.
`releaseOnce` is only with a single non-null input in production in two spots so no need for
varargs and any complexity here.
`ReleasableBytesStreamOutput` does not require any `releaseOnce` wrapping because we already have
that kind of logic implemented in `org.elasticsearch.common.util.AbstractArray` (which we were
wrapping here) already.
@jaymode jaymode self-requested a review July 22, 2020 14:57
Copy link
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

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

LGTM

@original-brownbear
Copy link
Contributor Author

Thanks Jay!

@original-brownbear
Copy link
Contributor Author

@elasticmachine update branch

@original-brownbear original-brownbear merged commit 785a91c into elastic:master Jul 22, 2020
@original-brownbear original-brownbear deleted the simplify-releasable-bytes-stream-output branch July 22, 2020 21:41
original-brownbear added a commit that referenced this pull request Jul 23, 2020
The single element `close` calls go through a very inefficient path that includes creating
a one element list.
`releaseOnce` is only with a single non-null input in production in two spots so no need for
varargs and any complexity here.
`ReleasableBytesStreamOutput` does not require any `releaseOnce` wrapping because we already have
that kind of logic implemented in `org.elasticsearch.common.util.AbstractArray` (which we were
wrapping here) already.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants