In that case - especially as you are dealing with possibly large image data - the bottleneck might be serialization/deserialization that happens all the time. If you pass (publish/subscribe) data as a shared_ptr this does not happen as a special case, see intraprocess publishing.