Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have 300-500 images and other files that my program uses. I realize I have two options:

  1. Save them in a binary format such as BMP which is loaded dynamically.
  2. Save them in a C source file such as XPM which allows it to be compiled into the program, but it also can be loaded dynamically.

Assuming both are just as easy to implement and I don't require dynamic loading, what are benefits of each method?

How would the loading/startup speed compare?

share|improve this question
add comment

2 Answers

Also remember,

  1. You will need a rebuild of your program every time you change an image (This is prior to release).
  2. Editing / previewing the image is crazy hard when it is embedded in your program.
  3. Program bloat.I would argue this forces the OS to load the entire program when some images aren't necessary - but this is very OS implementation dependent.
  4. Localization / having multiple versions per your customer needs is a pain when you embed.
share|improve this answer
    
Having to rebuild every time an image changes is no more onerous than having to rebuild after each source file change. A file change is a file change. –  Donal Fellows Mar 17 '12 at 20:01
1  
Have you done builds that take 3-4 hrs Donal? It matters as project gets bigger. –  Subu Subramanian Mar 18 '12 at 15:51
add comment

With the first choice you possibly decrease memory footprint (by loading only what you want), but if it will ever show up depends on the OS you use — if the OS mmaps the executable, you'll probably get nothing.

With the second one you save yourself a little bit of deployment hassle. Also, if you're going for a portable distribution stored on a flash stick, a single file is much quickier to read at once than hundreds of small ones.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.