Jump to content
  • Advertisement
Sign in to follow this  
Toonkides

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

This topic is 5042 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!