Timeline for Reading from large binary files
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 16, 2021 at 17:23 | vote | accept | Daniel Duque | ||
Dec 13, 2021 at 13:07 | history | edited | Toby Speight | CC BY-SA 4.0 |
non-code fence
|
Dec 13, 2021 at 3:00 | history | tweeted | twitter.com/StackCodeReview/status/1470227034379100162 | ||
Dec 13, 2021 at 0:14 | comment | added | Peter Cordes |
C++ makes it very inconvenient to make uninitialized space in a std::vector to read bytes into with I/O, but copying one T at a time with .push_back from a new buffer is almost certainly worse than just growing and letting a stupid compiler zero the bytes unnecessarily, then reading into that space. At best this copy loop will optimize to a call to memcpy , but maybe not with the growth check and possible reallocation after some data-dependent number of elements copied.
|
|
Dec 12, 2021 at 22:51 | history | became hot network question | |||
Dec 12, 2021 at 16:32 | answer | added | indi | timeline score: 9 | |
Dec 12, 2021 at 14:51 | history | asked | Daniel Duque | CC BY-SA 4.0 |