Sign in to follow this  
raptorstrike

saving as external text vs. saving as part of project

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
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

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