-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Create an array-based version of ChunkedToXContentBuilder #119063
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
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? |
@thecoop I finally got around to be profiling this stuff in some detail. => there's no point in messing with this stuff on a per response basis. I'd suggest we asap revert the builder stuff for the time being. Reverting to the old code brings back better than before performance numbers in my testing because part of the Lucene 10 improvements became invisible with the builder introduction on the bulk response. |
Use fixed-size arrays, but the methods and semantics of
ChunkedToXContentBuilder
Fixes #118647