Skip to content

using unique_ptr::get() , rather than cloning/recreating/deleting in a tight loop

Hey @rnaranjo I guess or I hope that in this case we can use foo* =unique_ptr::get to use the payload rather than cloning it and creating new unique_ptr inside loops. So I am modifying some of the code you altered in !20512 (merged) hoping to resolve some of the issues discussed there .

More or less getMaterialEffects seems to take up ~ 34% of the time ~8.5% for the cloning (ctor) ~25.5% for deleting (dtor) the unique_ptr managing the local Clone.

While in reality we could just .get() the managed pointer and Clone/delete nothing

Screenshot_2019-02-08_at_12.41.45

Edited by Christos Anastopoulos

Merge request reports