Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, February 2007
Resource system and large files


Message 1 in thread

Hi,

I have a very large database file that I want to include in the 
executable file of my program. the file size may reach 2 Gigabytes. is 
it a good idea to use the QT resource system? or do you recommend using 
each OS's resource system and write the required code to load the 
information I want?

Thanks in Advanced.
Daher

--
 [ signature omitted ] 

Message 2 in thread

On Sunday 25 February 2007, Daher wrote:
> I have a very large database file that I want to include in the
> executable file of my program.

Poor executable...

> the file size may reach 2 Gigabytes. is 
> it a good idea to use the QT resource system? or do you recommend using
> each OS's resource system and write the required code to load the
> information I want?

It is not a good idea to include such large files in the executable at all. 
The resource systems of Qt and the operating system(s) are not made for 
this. They are usually designed for very small resources, like translation 
strings or icons, of only a few bytes up to a few kB.

Simply put: expect everything that is a compiled-in resource to end up in 
main memory. Hence you would waste 2GB of RAM(!!) just for the comfort of 
having this file compiled in.

No program that needs such a big "database" will come in a single file (or 
at least: it should not for maintainability), so it does not hurt to have 
the file as another independent file in the distribution.

Another point of common sense: if you need to deliver over 2GB of data 
pre-installed with your program - why use a file based (embedded) database? 
Why not use a more professional SQL-based database system?



	Konrad

Attachment:

Attachment: pgpBo4jX2gyit.pgp
Description: PGP signature