Using std::list

Everything about development and the OpenMW source code.
Post Reply
mark
Posts: 10
Joined: 12 Jun 2012, 09:05

Using std::list

Post by mark »

Hi, I quickly grepped through the codebase and found several places where you use lists from the STL. It is generally a good idea to use standard containers, but maybe you are interested in this:
I found this article (part1, part2) where a Starcraft developer writes about the early development and problems with linked lists. He writes that non-intrusive lists improved performance very much and reduce errors. The boost documentation seconds that in two articles (general comparison, performance comparison).
I did not check in which context you use std::list and what your policy regarding containers is but maybe you could improve speed and quality with non-intrusive lists, if you like :)
Last edited by mark on 11 Sep 2012, 09:02, edited 1 time in total.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Using std::list

Post by Zini »

We haven't even started working on container optimisation (there is an issue for it on the tracker though). Personally I tend more to a std::vector or a std::deque as a starting point. There is little benefit in using lists at all. But ultimately only profiling can tell us what works best.

btw. std::list is a non-intrusive list. You probably mean the advantages of an intrusive list instead.
mark
Posts: 10
Joined: 12 Jun 2012, 09:05

Re: Using std::list

Post by mark »

Zini wrote:btw. std::list is a non-intrusive list. You probably mean the advantages of an intrusive list instead.
err yes, I meant that. I corrected my previous post, I did not see that my text could be misleading :)
Post Reply