Description
We are experiencing some performance issues with the current display list serialization and deserialization implementation.
We believe that the majority of this is related to codegen issues between serde and rustc. It's possible these will be resolved in the future, but it would be good to have written down what the benefits of the current implementation are. That way, if we consider any changes to the current method, we can ensure we don't miss any of the required functionality.
As an extreme example, consider if we had something similar to the old method - the display list is a set of flat arrays of data, which is simply copied / shared to WR.
The benefits I'm aware of with the current implementation:
- bincode gives us compression, reducing the amount of memory that needs to be shared or copied.
- We get some level of safety in terms of not needing to validate the display list contents.
The value of (1) seems clear (although we may want to quantify that somehow if we haven't already?). It's less clear to me how (2) works - could we write up an example or two of how this provides safety?