Op dinsdag 3 december 2013 10:33:47 UTC+1 schreef Ilia Mirkin:
>
> You mentioned you added a reserve function. Are you talking about 
>
> accelContainer.mutable_data()->Reserve(event.size)? 
>
 
*Yes *
 

> Unfortunately that will still construct the object when calling 
> add_data. You may consider getting rid of the sub-object and just 
> having repeated x/y/z. It's not as nice, but should be faster. 
>
 
*This method does yield more performance. The data usage is smaller aswell.* 


*I'll stick to this method and try to optimize further.*

> Where does event.data come from? Perhaps it can be a RepeatedPtrField 
> that is populated with the accel data as it comes in? Then you can 
> just use ->Swap() to copy it into place. 
>
> On Tue, Dec 3, 2013 at 4:24 AM, Mathijs Jonker 
> <mathij...@msn.com<javascript:>> 
> wrote: 
> > Is there some other way that I can use so the elements are added faster? 
> > 
> > Op maandag 2 december 2013 21:15:41 UTC+1 schreef Mathijs Jonker: 
> >> 
> >> Sorry I meant microseconds, my bad. 
> >> The total time spend however is 0.256 seconds. 
> >> Which I find quite long. 
> > 
> > -- 
> > 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 <javascript:>. 
> > To post to this group, send email to prot...@googlegroups.com<javascript:>. 
>
> > Visit this group at http://groups.google.com/group/protobuf. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
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 http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to