Jump to content
  • Advertisement
Sign in to follow this  
raptorstrike

saving as external text vs. saving as part of project

This topic is 4980 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

whitch one takes more RAM or is it the same? in case you didnt get it from the thread name whitch one of these methods would save more RAM read data from external text file or have the same data embeded right into a header? thanks[smile]

Share this post


Link to post
Share on other sites
Advertisement
I'm assuming you're talking about a programming project, where you either have bunch of string literals in your code itself, or if you put all of the text into a file that you open at runtime and read from. You were a bit vague...

Putting your data into your code will mean that it is part of the executable. And at least on Win32 platforms, probably others, when you run a program, the whole executable is loaded into memory. Thus, your string literals will be in loaded in memory during the entire execution of your program, regardless of whether you are needing that data or not at any particular moment.

If you put it in a file, however, you can open the file whenever you need the info, close it when you're done, read only bits and pieces at a time, etcetera. In general, it will probably be [or at least, can be) more memory efficient and flexible.

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!