Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 2
    If it helps, here's dd's source code: lingrok.org/xref/coreutils/src/dd.c
    – jason
    Commented Mar 27, 2013 at 18:24
  • 1
    I believe fstreams have some overhead dealing with locales, but dd appears to be using read which has none of the associated locale-checking. Even in ios::binary mode, you still pay some of that penalty. How does your perf change if you use a FILE* instead? It's not as C++, but if perf is your concern...
    – Dan Lecocq
    Commented Mar 27, 2013 at 18:27
  • Is it better to use FILE* or just a straight read using file descriptors?
    – KyleL
    Commented Mar 27, 2013 at 18:28
  • What is 'do something with data'? Since dd simply outputs it, in your case to dev null.
    – Dave S
    Commented Mar 27, 2013 at 18:37
  • I'm sure, that you tried all this stuff in Release mode, but if not - there could be worth results in Debug
    – borisbn
    Commented Mar 27, 2013 at 18:38