|
|
|
|
|
by Jenya_
1910 days ago
|
|
On my work we do use linked lists, they are simple and convenient to collect a few items of data together when the item count is not known in advance. The trick is to allocate linked list structures from the arena allocator (which keeps these structures close in memory). The programs in my work may run for days and may use terabytes of RAM (EDA chip design verification). I agree that linked lists could be optimized, but usually they are not the worst offender. The biggest gains in performance usually happen when an accidental O(n^2) slowdown is replaced with a correct n*log(n) version. |
|
If you need a linked list, use an array with indices and you can cut the size in half if you don't need 64 bit integers. If it has to be enormous, make a linked list of arrays for better locality.