-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Create an array-based version of ChunkedToXContentBuilder #119063
base: main
Are you sure you want to change the base?
Conversation
11e0d0e
to
919f514
Compare
I'm sorry @thecoop but I fail to see what this is trying to achieve. |
Can you point to how this will be slower? The objects returned are the same types returned by the previous |
This one in isolation isn't much slower but even this still has the negative effect of duplicating existing implementations in |
This is a WIP - the code here is an example of the changes I would like to make. I am continuing to refactor the old builder to the new one now. I want to do this change because it makes the code easier to understand and less error-prone, especially given the obtuseness of some exceptions when you mis-match start and end blocks. The methods here are designed to minimise the chances of doing that by doing the start and end for you, in the same style as I also did these changes as there was little documentation or comments specifying the performance-critical nature of this code. May I suggest adding assertions for specific types, and extensive comments explaining what is going on, if these are necessary to ensure certain calls do not turn megamorphic? |
Use fixed-size arrays, but the methods and semantics of
ChunkedToXContentBuilder
Fixes #118647