apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.04k stars 3.92k forks source link

Support arena allocation for server mode in native protocol #2671

Open oathdruid opened 1 week ago

oathdruid commented 1 week ago

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?) protobuf introduce arena allocation technology long ago from 3.x version, which could help to reduce dynamic memory allocation cost when large message is met.

brpc do request and response heap allocation deep inside the implementation of protocol, make it hard extend to enable arena allocation. hard like this example use-arena-with-brpc

thanks to the depend on head style inside baidu, tricks like this could also be maintained by keep sync to brpc head version but in out side world, do this patching once and for all seems impossible

Describe the solution you'd like (描述你期望的解决方法) design an standalone plugin point make request and response creation easy to customize. or just provide arena allocation mode in native protocol

Describe alternatives you've considered (描述你想到的折衷方案)

Additional context/screenshots (更多上下文/截图)