Start here · Essential guide
List vs Array in C++
Compare C++ arrays, std::array, std::vector and std::list by memory layout, element access and insertion cost, with code and a simple rule for choosing.
Strings, Containers and Memory
When to pick a list or an array, with comparisons from C# and Python.
Start here · Essential guide
Compare C++ arrays, std::array, std::vector and std::list by memory layout, element access and insertion cost, with code and a simple rule for choosing.
Cython is usually no faster than hand-written C. Untyped code stays slow, and typed loops can get close to C speed. Here is what to expect and why.
In C++, start with std::vector, use std::array when the size is fixed, and reach for std::list only in rare cases. Here is a quick way to decide.
list() and [] both make a new empty Python list. Learn how they differ when converting iterables and in speed, and how C++ std::vector compares.
In C#, arrays are usually a bit faster than List for indexed access, but the gap is often small. Here is why, and how to measure it yourself.
Related topics