This is a benchmark of various different strategies for creating clones of an object whose structure is known ahead of time.
In this test we assume that we always want to produce a clone of the same object and that the object contains no circular references, outside pointers, or non-JSON-serializable objects.
The use-case for such cloning is to have a "template" data structure that then gets copied and mutated for each request, leaving the template untouched. This is useful if only a small part of the data structure gets altered on each request and most of it remains set to what is in the template.
In all cases the functions were written to do as much as possible ahead of time so that the copy function could execute as quickly as possible. (Some variants on pre-processing were tried and eliminated before arriving at this final test set. The rejected variants are not reflected in the results or the