Sign in to follow this  
Toonkides

fopen ifstream -- OK, what's the deal !?

Recommended Posts

So ya the c++ implementation of reading files is nice, but come on, what's better ? fopen : 12.9 seconds to copy 10 megs OR ifstream : 17.3 seconds to copy 10 megs? It's a tough one, but when making a game that requires constant loading of textures and data, what would be better ? I have yet to learn the fopen library well, but so far it seems awesome. Does anyone know of a faster method ? Thanks in advance

Share this post


Link to post
Share on other sites
For something as simple as copying data, I'd be surprised if there was that much difference between the two libraries. Are you comparing fread/fwrite with istream::read/ostream::write? What buffer size are you using?

Of course, whatever result you get depends on your compiler's library implementation. When the C++ iostreams library first came about, many were just built on top of the old C library, but they're *apparently* are a lot better now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this