C++ Logo

std-proposals

Advanced search

Re: Cache Alloc - 1.3x to 13.4x faster

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 27 Jul 2021 10:08:12 -0700
On Tuesday, 27 July 2021 09:26:33 PDT Phil Bouchard via Std-Proposals wrote:
> Yes I can use a more efficient chained buffer but the
> complexity remain the same.

The problem is using a chained buffer in the first place. You're violating the
engineer's motto: use the right tool for the right job.

std::list and other chained containers are good for insertions at any point
with constant timing and no copying/moving. They are not good for raw
iteration performance or for overhead performance. They make far more
allocations than an array container.

Now, there's nothing wrong with improving std::list beyond what's already
there for the use-cases it has. But I have not seen a comparison from you on
whether changing containers would improve performance more than the effort
you're going through.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2021-07-27 12:08:17