That function is being called a lot when for example generating dumps (once for each of our 130M+ statements), and I found it to be rather slow (when profiling the dumpers locally).
By just inlining some of the function calls it does (or even just the ifs in the functions called by getDeserialized), we can probably gain a significant speedup.
During some playing around, I managed to get a speedup of about 6-7% when inlining getDeserialized into deserialize and by pulling the initial guard ifs from the set… functions up into the calling code.