[ 
https://issues.apache.org/jira/browse/MESOS-6972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16043468#comment-16043468
 ] 

Dmitry Zhuk commented on MESOS-6972:
------------------------------------

Yeah, this will not work with arenas, but I'm not sure if arenas are a better 
alternative.
I presume you're referring to using arenas for parsing incoming messages?
I just think about {{reregisterSlave}}, which basically takes all incoming data 
and puts it inside master's internal data structures. This seems like a typical 
flow for handling message: doing some validation, etc. and then passing the 
incoming data to the same or another process with {{defer}}. So technically we 
get faster message parsing with arena, but then we need to deep copy this data 
for passing it further anyway. Without arenas, parsing is slower, but then we 
can use {{std::move}} and {{Swap}} (I have some ideas about making something 
like {{protobuf::move}} invoking {{Swap}} behind the scenes) to avoid any extra 
overhead on copying. Am I missing something here?

> Improve performance of protobuf message passing by removing RepeatedPtrField 
> to vector conversion.
> --------------------------------------------------------------------------------------------------
>
>                 Key: MESOS-6972
>                 URL: https://issues.apache.org/jira/browse/MESOS-6972
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Benjamin Mahler
>              Labels: tech-debt
>
> Currently, all protobuf message handlers must take a {{vector}} for repeated 
> fields, rather than a {{RepeatedPtrField}}.
> This requires that a copy be performed of the repeated field's entries (see 
> [here|https://github.com/apache/mesos/blob/9228ebc239dac42825390bebc72053dbf3ae7b09/3rdparty/libprocess/include/process/protobuf.hpp#L78-L87]),
>  which can be very expensive in some cases. We should avoid requiring this 
> expense on the callers.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to