What influences C++ I/O performance?

E

Erik Wikström

[ ... ]
I only have VS 2008 Express, so I don't know, but it seems possible.

If you previously said you were using the "Express" edition, I didn't
catch it.

In any case, that's almost certainly the majority of the explanation
right there. Much of what they do in the Express edition of the compiler
is disable nearly _all_ optimization. Since iostreams are templates,
that means most of the code involved is being compiled with virtually no
optimization applied.

Fortunately, this is fairly easy to fix: the full version of the
compiler is included with (among other things) a number of versions of
the Windows SDK. If you care about performance at all, I'd advise
downloading and using that (at least for final builds).

I forgot to add, the Windows Platform SDK comes as a part of Visual C++
2008 Express, so downloading it again will buy you nothing.
 
J

Jerry Coffin

[ ... ]
You know, it's just terribly disappointing and frustrating when one
finds out that even a stupid scripting language outperforms one's C++
implementation.

I'd be rather happy with that. Scripting languages tend to make
development and maintenance cheap and easy, so when they can do the job,
it's a great thing.

Most scripting languages are (at least partially) interpreted, so
execution speed tends to depend heavily upon the amount of code that
needs to be executed. When/if you can get the job done in only a line or
two of code, they'll typically be as fast as (and perhaps faster than)
anything you can reasonably write yourself. In particular, the code that
implements those few lines of code is likely to be used enough to
justify spending quite a bit of time and effort on optimizing them.

Chances are that when you recreate that functionality on your own that
you can't justify spending nearly as much time and effort on optimizing
this code, so you may not get a lot faster result.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top