[capnproto] Performance of iterating through List vs. raw Data

2019-08-13 Thread philipp . wissmann
Hi We used Cap'n Proto to serialize data in a shared memory environment and defined some message types as structs containining List, i.e. struct Message{ points @0 List(Vector3f) }; Where Vector3f is another struct containing either 3 floats or a List(Float32). However, extracting the Vecto

Re: [capnproto] Performance of iterating through List vs. raw Data

2019-08-13 Thread 'Kenton Varda' via Cap'n Proto
Hi Philipp, This is a bit of an unusual case, where I imagine you are working with bulk vector data forming a 3D mesh or some such, and in order to hand if off to the graphics card, you really need a direct pointer to the underlying data and you need it to be in a specific layout. Using Data is t

Re: [capnproto] Performance of iterating through List vs. raw Data

2019-08-15 Thread Philipp Wissmann
Hi Kenton Thanks a lot for this amazingly fast reply and the explanations. We might try the direct pointer approach and it's very useful to know this possibility but for now I think having the data in a Data member seems to be working. Cheers! Philipp On Tuesday, August 13, 2019 at 7:43:08

Re: [capnproto] Performance of iterating through List vs. raw Data

2022-09-21 Thread Hui min
I want to ask a related question, and found out this thread. >From what I understand in the discussion, if I have struct Vector3d { x @0 :Float64; y @1 :Float64; z @2 :Float64; } and then struct Point3Array { data @0 :List(Vector3d); } Will i get a perfectly packed array of Vector3d in memory

Re: [capnproto] Performance of iterating through List vs. raw Data

2022-09-21 Thread Hui min
Another comment, I would also agree probably using raw data as the type is more appropriate, with a metadata information to encode the endianess. This would be similiar to http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/PointCloud2.html On Thursday, 15 August 2019 at 3:25:09 pm UTC+8 Ph

Re: [capnproto] Performance of iterating through List vs. raw Data

2022-09-21 Thread 'Kenton Varda' via Cap'n Proto
On Wed, Sep 21, 2022 at 9:42 AM Hui min wrote: > I want to ask a related question, and found out this thread. > > From what I understand in the discussion, if I have > > struct Vector3d { > x @0 :Float64; > y @1 :Float64; > z @2 :Float64; > } > > and then > > struct Point3Array { > data @0 :List(