Open Bug 1796594 Opened 2 years ago Updated 2 years ago

Serialize ByteBuf using Write/ReadSequenceParam

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: nical, Assigned: nical)

References

(Blocks 1 open bug)

Details

I am told it involves less copies than WriteBytes/ReadBytesInto.

How/why?

Flags: needinfo?(nical.bugzilla)

Quoting Nika:

If the buffer is a sequence of trivial numeric types, and the length is over 64k bytes, it [WriteSequenceParams] allocates a temporary shared memory region and sends that instead.

WriteBytes copies the data into the IPC::Message's buffer, and then that is copied into a system pipe, the nout of it into another IPC::Message, and then finally read into your final thing. IPC::Message uses a BufferList right now, meaning that it serilizes data into 4k chunks

Flags: needinfo?(nical.bugzilla)

Are there benchmarks that show the advantages of the shared memory approach?

Flags: needinfo?(nika)

Nope, there aren't really any major benchmarks showing improvements there. It's mostly a lever to consider pulling if we think we'll see performance improvements from the change due to seeing the existing memcpys in profiles.

I think for extremely large messages (megabytes) we could see some improvements, but I wouldn't expect to see much change at all for reasonably sized messages.

Flags: needinfo?(nika)
You need to log in before you can comment on or make changes to this bug.