Re: [protobuf] Protobuf arena, perfomance

2018-04-07 Thread sazonchg
Ok, thanks for reply.
Best regards, Dmitry.

пятница, 6 апреля 2018 г., 21:35:44 UTC+3 пользователь Feng Xiao написал:
>
>
>
> On Fri, Apr 6, 2018 at 5:02 AM > wrote:
>
>> Hello, everybody.
>> I would like to detail some moments about protobuf arena.
>> In my project there is a structure with ~100 fields. 
>> I compared elapsed time for parse and serialize methods with arena and 
>> without it.
>>
>> 1.Arena: 
>> 
>> google::protobuf::Arena arena;
>> ProtoStruct message  = 
>> google::protobuf::Arena::CreateMessage(&arena);
>> while (is_testing) {
>>
>> packet.ParseFromArray(...)
>> ...read fields, change fields
>> message.SerializeToArray(...);
>>
>> }
>>
>> 2.No arena:
>>
>> ProtoStruct message
>> while (is_testing) {
>>
>> packet.ParseFromArray(...)
>> ...read fields, change fields
>> message.SerializeToArray(...);
>>
>> }
>>
>> The results didn't show any difference. 
>> I used 3.3.1.189 version and cloned from master branch, which allocates 
>> strings in arena. 
>>
>> From this topic (https://github.com/google/protobuf/issues/4327)
>> I see that there is no benefits from arena usage now. 
>> Is It true or I do something wrong?
>>
> Right now opensource protobuf arena only works well when you have a deep 
> message hierarchy but without string fields (which is very unlikely in most 
> common use cases). I suggest you wait for the support of STRING_PIECE to be 
> in place before trying arena again.
>  
>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Protobuf arena, perfomance

2018-04-06 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Apr 6, 2018 at 5:02 AM  wrote:

> Hello, everybody.
> I would like to detail some moments about protobuf arena.
> In my project there is a structure with ~100 fields.
> I compared elapsed time for parse and serialize methods with arena and
> without it.
>
> 1.Arena:
> 
> google::protobuf::Arena arena;
> ProtoStruct message  =
> google::protobuf::Arena::CreateMessage(&arena);
> while (is_testing) {
>
> packet.ParseFromArray(...)
> ...read fields, change fields
> message.SerializeToArray(...);
>
> }
>
> 2.No arena:
>
> ProtoStruct message
> while (is_testing) {
>
> packet.ParseFromArray(...)
> ...read fields, change fields
> message.SerializeToArray(...);
>
> }
>
> The results didn't show any difference.
> I used 3.3.1.189 version and cloned from master branch, which allocates
> strings in arena.
>
> From this topic (https://github.com/google/protobuf/issues/4327)
> I see that there is no benefits from arena usage now.
> Is It true or I do something wrong?
>
Right now opensource protobuf arena only works well when you have a deep
message hierarchy but without string fields (which is very unlikely in most
common use cases). I suggest you wait for the support of STRING_PIECE to be
in place before trying arena again.


>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Protobuf arena, perfomance

2018-04-06 Thread sazonchg
Hello, everybody.
I would like to detail some moments about protobuf arena.
In my project there is a structure with ~100 fields. 
I compared elapsed time for parse and serialize methods with arena and 
without it.

1.Arena: 

google::protobuf::Arena arena;
ProtoStruct message  = 
google::protobuf::Arena::CreateMessage(&arena);
while (is_testing) {

packet.ParseFromArray(...)
...read fields, change fields
message.SerializeToArray(...);

}

2.No arena:

ProtoStruct message
while (is_testing) {

packet.ParseFromArray(...)
...read fields, change fields
message.SerializeToArray(...);

}

The results didn't show any difference. 
I used 3.3.1.189 version and cloned from master branch, which allocates 
strings in arena. 

>From this topic (https://github.com/google/protobuf/issues/4327)
I see that there is no benefits from arena usage now. 
Is It true or I do something wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.