January 2019

The SoA Vector – Part 2: Implementation in C++--Sidney Congard

The series continues and end.

The SoA Vector – Part 2: Implementation in C++

by Sidney Congard

From the article:

Like we saw in the first part of this series on SoA, the SoA is a way to organise the data of a collection of objects to optimise the performance of certain use cases: traversing the collection by accessing the same data member of all the objects:

struct person {
   std::string name;
   int age;
};

std::vector<person> persons = ...

for (auto& person : persons)
{
   ++person.age;
}
struct person {
   std::string name;
   int age;
};

std::vector<person> persons = ...

for (auto& person : persons)
{
   ++person.age;
}

The SoA in its barest expression is this:

struct persons {
    std::vector<std::string> names;
    std::vector<int> ages;
};
struct persons {
    std::vector<std::string> names;
    std::vector<int> ages;
};

By putting all the ages next to each other in memory, we optimise the performance of the traversal. But such a structure is not a container in itself, and is in particular not compatible with the STL.

Let’s design an SoA collection with an interface as close as possible to std::vector<persons>, but with the SoA structure of components stored in separate arrays...

C++ ... in 2018 -- Bartłomiej Filipek

cppin2018.PNGA retrospective of all the things that happened in C++-dom in 2018:

C++ ... in 2018

by Bartłomiej Filipek

From the article:

2018 is almost over (just a few hours left in Poland till midnight). As in previous years, I did a summary of many things that happened in the C++ community. This year seems to be marked with a solid progress towards the standardisation of C++20, using more and more C++17 and as always the growth in the community.

Let’s have a look...

TODO_BEFORE(): A clean codebase for 2019 -- Aurelien Regat-Barrel

2019.PNGMay your new years ever be happier than your old years -- now there's a great use for a monotonically increasing function!

Here is the latest uplifting contribution, with thanks to the Fluent C++ blog:

TODO_BEFORE(): A clean codebase for 2019

by Aurelien Regat-Barrel

From the article:

How and why do we accumulate technical debt in the first place? How do we find ourselves in a situation where things seem to be out of control? And more importantly: how to recover and improve from such a situation? ...