Skip to content

Remove ChunkedToXContentBuilder #119310

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

Merged

Conversation

original-brownbear
Copy link
Contributor

Reverts the introduction of the ChunkedToXContentBuilder to fix the various performance regressions it introduced and the theoretical impossibility of fixing its performance to rival that of the iterator based solution.
With the exception of a few minor adjustments that came out of changes already made on top of the builder migration this simply returns to the previous implementations (and some of the stuff in that code could be done better with the utilities available now).
I also verified that this solves the performance issues that we've been running into with the builder.

closes #118647

@original-brownbear original-brownbear added >bug :Search/Search Search-related issues that do not fall into other categories :Distributed Coordination/Network Http and internode communication implementations v9.0.0 v8.18.0 labels Dec 27, 2024
@original-brownbear original-brownbear requested a review from a team as a code owner December 27, 2024 14:43
@elasticsearchmachine elasticsearchmachine added Team:Search Meta label for search team Team:Distributed Coordination Meta label for Distributed Coordination team labels Dec 27, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

@elasticsearchmachine
Copy link
Collaborator

Hi @original-brownbear, I've created a changelog YAML for you.

@original-brownbear original-brownbear changed the title Revert builder stuff Remove ChunkedToXContentBuilder Dec 27, 2024
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM (assuming CI is happy anyway)

I haven't really contemplated alternatives, but I honestly don't think the API based around Iterator is meaningfully harder to use (or read) than the builder-based one. It seemed a little neater at the outset but clearly has performance issues that aren't easy to solve, and we can't reasonably keep such a significant regression in place simply for fairly subjective code-aesthetics reasons even while we work towards an eventual solution that is both performant and pleasing.

@original-brownbear
Copy link
Contributor Author

Thanks David!

@original-brownbear original-brownbear added the auto-backport Automatically create backport pull requests when merged label Dec 27, 2024
@original-brownbear original-brownbear merged commit c0553d4 into elastic:main Dec 27, 2024
16 checks passed
@original-brownbear original-brownbear deleted the revert-builder-stuff branch December 27, 2024 21:00
@thecoop
Copy link
Member

thecoop commented Jan 3, 2025

@original-brownbear This has not been backported to 8.x...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :Distributed Coordination/Network Http and internode communication implementations :Search/Search Search-related issues that do not fall into other categories Team:Distributed Coordination Meta label for Distributed Coordination team Team:Search Meta label for search team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ChunkedToXContentBuilder should be removed
4 participants