3 ms·
Is the comparison really fair? On a 64-bit system, the `std::unique_ptr<int>` takes 8 bytes, while a linked list node takes at least 24 bytes (as it must have a
by netheril96 11y ago
Is the comparison really fair? On a 64-bit system, the `std::unique_ptr<int>` takes 8 bytes, while a linked list node takes at least 24 bytes (as it must have a previous and next pointer). The larger sizes means less number of values can be in the cache at any time and may be the real reason for the slowdown.
- larshagencpp 11y agoThis is the reason that the problem was simplified to using vector<pair<int,int>> for all the experiments, so no difference in data size.