Bug #78664
closedTransientMemoryBackend + VariableFrontend = unserialize/serialize mayhem
100%
Description
When combining a VariableFrontend with a TransientMemoryBackend it would be possible to store variables directly instead of forcing them to be serialized and unserialized repeatedly. Per definition, a TransientMemoryBackend is able to hold references to objects but the VariableFrontend is unaware of the backend type and so only passes string values that it has serialized, and only returns values it unserialized from strings. Perhaps worse, the TransientMemoryBackend throws an exception if attempting to store anything other than a string - which makes little sense given the above.
With a few simple modifications and an additional contract indicating that a backend is capable of holding references as well as arbitrary data types, the VariableFrontend can use transient memory storage MUCH more efficiently.
An example profile I'm watching right now has approximately 100 copy operations which are heavy on the ReferenceIndex which in turn is heavy on the runtime cache, now shows no less than 30,000 fewer calls to unserialize.