eclipse-vertx / eclipse-vertx/vert.x
HttpEventHandler.body should avoid being resized
- Dominant language
- Java
- Stars
- 14.7k
- Forks
- 2.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 28
Description
Handling chunks requires appending Buffer(s) in the body stored at HttpEventHandler.
See
https://github.com/eclipse-vertx/vert.x/blob/d5f613c69cf6ed3a9ed3586e5be1896b11711462/vertx-core/src/main/java/io/vertx/core/http/impl/HttpEventHandler.java#L54
This can both create excessive heap footprint and performing useless copies.
It would be ideal if we could retain the chunks accumulating them in some list or queue and eventually allocating a single buffer to copy or transferring them to a composite buffer (without copying anything).
I have used a similar strategy in https://github.com/quarkusio/quarkus/blob/b870c90569a4c88467313587565205818034f4df/independent-projects/vertx-utils/src/main/java/io/quarkus/vertx/utils/AppendBuffer.java#L19
Contributor guide
Assessment
This issue has not been assessed yet.