dao-jun commented on PR #22510: URL: https://github.com/apache/pulsar/pull/22510#issuecomment-2057918401
> > I have seen those PRs, great stuff, but the problem here is about the serialization happening in some upgredictable place, like this: > > Trying to understand this more deeper. What is the impact of using the default serialization in this case? how does the StreamingOutput based serialization improve the situation? @lhotari I guess the default implementation of the jetty is ```java String jsonString = JSON.toJsonString(object); httpOutput.writeString(jsonString); ``` It will generate the jsonString first and then send it to the client. But by this PR, it doesn't need to generate the jsonString first in the memory, but sends the result to the client directly. So we can reduce heap memory usage and avoid more memory copies. @eolivelli Am I right? I support the PR, it could help a lot if the response body is huge. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
