It should be the same code since I took the code from there. Basically in my test program, getObject took 46ms, deallocating the returned Model took 5ms, and the remaining difference in time between allocating/deallocating optionals and the shared_ptrs.

Basically in this specific instance, I wanted to avoid the overhead of these helper functions since it is called often.