On Monday 28 November 2016 11:40:03 André Somers wrote:
> Anyway: see the blog or one of the recorded talks from Qt conferences on 
> this topic. You will want to get into the habbit of raising a red flag 
> whenever you do a code review and find a QList, and start typing QVector 
> instead of QList whenevery you write code yourself.

Unless you:

- Alredy have to interact with a QList-based API.
- Prefer the smaller footprint of QList in the binary.
- Are using an old Qt version, and prefer the more complete API of QList.
- Are writing a function that, like most of the functions of Qt-using apps, 
won't get any benefit of changing one container with another.

Yes, yes, yes. I use QVector now more often than QList because I agree that 
the design decisions done to create QList are out of date. But I still dispute 
the claim that you can notice a change in the choice of container on anything 
that is not a very specific part of the application. You almost always iterate 
in a container to do something productive to the user, and that touches disk, 
network, screen, speakers, etc.

And Mark Mutz's benchmark is extremely unfair since it only tests append(). 
Bjarne Stroupstrup showed a much more fair example where he explained a 
problem where insertions and removals were random and evenly distributed. But 
it was comparing std::vector and std::list.

So, no, I don't question the theory, but I see extraordinary claims without 
much evidence about the real impact.

-- 
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to