What if some objects cannot be shared, but they are comparable, and it is likely there were identical instances written to the stream before?
We could optimize this use-case by having positive and negative "previous object" IDs. The positive ID would be a normal reference to a previous instance, and the negative ID would mean a "new instance", but with the same data.
OTOH, it is likely that even a lightweight compression API could make this a futile optimisation.
What if some objects cannot be shared, but they are comparable, and it is likely there were identical instances written to the stream before?
We could optimize this use-case by having positive and negative "previous object" IDs. The positive ID would be a normal reference to a previous instance, and the negative ID would mean a "new instance", but with the same data.
OTOH, it is likely that even a lightweight compression API could make this a futile optimisation.