Timeline for Why can 'dd' read from a pipe faster than my own program using ifstream?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 29, 2013 at 23:48 | vote | accept | KyleL | ||
Mar 28, 2013 at 0:13 | history | edited | KyleL | CC BY-SA 3.0 |
added 198 characters in body
|
Mar 28, 2013 at 0:11 | comment | added | KyleL | @ipc I ran a test and you're right about the heap. Changing Program 2 to use malloc'd memory cuts the performance to the same as program 1. | |
Mar 27, 2013 at 23:14 | comment | added | s3rius | @ipc Heap memory isn't slower, and since a vector stores its data contigously, shouldn't the difference only be an additional pointer indirection? | |
Mar 27, 2013 at 22:08 | comment | added | ipc | The difference between vector and a plain static char array is, that the char array is on the stack while the vector allocates the data on the heap. I'm a little surprised that you don't get a stack overflow. | |
Mar 27, 2013 at 21:06 | comment | added | Randy Howard | I would expect the raw interface version to run faster. Why does it surprise you? | |
Mar 27, 2013 at 20:26 | history | edited | KyleL | CC BY-SA 3.0 |
added 546 characters in body
|
Mar 27, 2013 at 20:09 | history | answered | KyleL | CC BY-SA 3.0 |