Hi there,

I'm using protobuf on a Embedded system.
While I'm trying to add large amount of data I'm running into the issue 
that the container.add_data() for repeated fields takes long.

I'm trying to add 8000 elements by calling add.

for(size_t i = 0; i < event.size; i++) {
> // Create a new accel protobuf
> ::pb_Accel* newAccel = accelContainer.add_data();
>
>  // Set the data
>
newAccel->set_x(event.data[i].X);
> newAccel->set_y(event.data[i].Y);
> newAccel->set_z(event.data[i].Z);
>  }
>

The add_data function takes 32 nanosecs. It does this for each call!
This gives a total time of 0.256 seconds. I want to optimize this so it can 
go faster.

I've already tried adding a reserve function before I enter the loop but 
that doesn't make any difference.

Any sugestions? Is there perhaps some other way of handeling pointers to 
the protobuf data?

Greets,
Mathijs

-- 
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