about support protobuf arena#1175
Closed
heyuyi0906 wants to merge 3 commits into
Closed
Conversation
Member
|
赞,好奇有多少的性能提升? |
Contributor
Author
Member
|
大包看起来效果不错,方便看下不同包大小的场景下(比如16B,32B,64B,128B,256B,512B...)的性能差异么,这些包更典型些 |
Contributor
Author
|
好,我补充下这块的数据 |
mapleFU
reviewed
Aug 20, 2020
|
|
||
| template<class T> | ||
| struct ArenaObjDeleter { | ||
| constexpr ArenaObjDeleter() noexcept = default; |
gydong
reviewed
Aug 21, 2020
| del(!cntl->get_memory_arena()->OwnObject()); | ||
| std::unique_ptr<const google::protobuf::Message, | ||
| butil::ArenaObjDeleter<const google::protobuf::Message> | ||
| > recycle_req(req, del); |
Contributor
There was a problem hiding this comment.
这种indent方式有些怪,可以统一成下面这样吗
std::unique_ptr<google::protobuf::Message,
butil::ArenaObjDeleter<google::protobuf::Message>> req;
std::unique_ptr<google::protobuf::Message,
butil::ArenaObjDeleter<google::protobuf::Message>> res;
| } | ||
| return _arena; | ||
| } | ||
| void share_memory_arena(Controller *cntl) { |
Contributor
There was a problem hiding this comment.
为保持和现有代码风格一致,引用和指针符号统一对齐到左边与类型挨着吧
|
|
||
| void operator()(T *ptr) const { | ||
| if (_own_obj) { | ||
| VLOG(199) << "delete!"; |
| > | ||
| CreateMessage(const google::protobuf::Message &proto_type) { | ||
| google::protobuf::Message *msg = proto_type.New(); | ||
| VLOG(199) << __FUNCTION__; |
Contributor
There was a problem hiding this comment.
FUNCTION 是哪里定义的宏,用__func__变量会更标准些吧
|
请问这个pr没合入是还存在什么问题么? |
Contributor
现在可以使用 #2718 中提供的功能,通过自定义RpcPBMessageFactory来支持arena |
Contributor
@limindlmu 可以看看#2751 。 |
Contributor
|
Closed this as completed #2751 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


#535
麻烦看下这个实现是否可以被接受,当前先只改了baidu rpc protocol。