Skip to content

Commit

Permalink
pandaproxy/json: Use zery-copy in rjson_parse
Browse files Browse the repository at this point in the history
An optimisation when parsing a body; the read chunks
should already be a suitable size.

Signed-off-by: Ben Pope <ben@redpanda.com>
  • Loading branch information
BenPope committed Jul 16, 2024
1 parent d5a6516 commit fac68ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/v/pandaproxy/json/rjson_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <seastar/http/request.hh>

#include <concepts>
#include <memory>

namespace pandaproxy::json {

Expand Down Expand Up @@ -155,7 +156,7 @@ rjson_parse(std::unique_ptr<ss::http::request> req, Handler handler) {
return ss::make_ready_future<ss::stop_iteration>(
ss::stop_iteration::yes);
}
buf.append(std::move(tmp_buf));
buf.append(std::make_unique<iobuf::fragment>(std::move(tmp_buf)));
return ss::make_ready_future<ss::stop_iteration>(
ss::stop_iteration::no);
});
Expand Down

0 comments on commit fac68ba

Please sign in to comment.