Prevent copy of protocol::object on protocol::SerializeObject
Summary:
Inside protocol::SerializeObject following statement:
val.objectValue_ref() = obj;
was making a copy of the object. This can be very costly when it is an object corresponding to a large struct. After this change, object serialization time reduced dramatically from 10X slower to 3X slower when compared to schema based serialization.
After perf numbers - https://docs.google.com/spreadsheets/d/1hlxjBt7PCi4tLUZO7NaZt5wBq22h3zi4-GjfbUP2xQU/edit?usp=sharing
Before perf numbers - https://www.internalfb.com/phabricator/paste/view/P549047640?lines=208
Reviewed By: Mizuchi
Differential Revision:
D41216856
fbshipit-source-id:
b5a79aad882c0318bf2556de27448f030bdd2e68