[Development] std::allocate_shared for QSharedPointer

Thiago Macieira thiago.macieira at intel.com
Sun Sep 10 14:26:45 CEST 2017


On Saturday, 9 September 2017 17:16:24 -03 Sean Harmer wrote:
> Yes, vtune shows the line
> 
> static_cast<ExternalRefCountWithContiguousData *>(::operator
> new(sizeof(ExternalRefCountWithContiguousData)));
> 
> is the bottleneck in this particular test case, qt3d/tests/manual/bigscene-
> cpp. I maybe able to reduce the calls to this by a small constant factor but
> I'm not sure yet, need to do some more digging/experimenting. So using a
> pool seemed like a viable approach to reducing this bottleneck.
> 
> Granted, this is an extreme stress test (1k QEntities, each with 2 x
> QPropertyAnimations) but it makes a nice one to profile.

Well, if you microbenchmark, then memory allocation is almost always a 
bottleneck. I'd be more interested in real-world numbers.

But anyway, I don't see a way to pool the private pointers. You always get a 
new one if you add a new pointer to an object.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list