Optimised dynamic object pickling