[Development] std::allocate_shared for QSharedPointer

Ed Leaver ewleaver at comcast.net
Tue Sep 12 02:45:01 CEST 2017


Have any of you experience with jemalloc or TCMalloc?
http://goog-perftools.sourceforge.net/doc/tcmalloc.html

On 09/10/2017 08:26 AM, Thiago Macieira wrote:
> 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.
>




More information about the Development mailing list