So you donβt want resources to be embedded in the application because it inflates the executable and loads too slowly, and you donβt want resources outside the application because they are too slow to load?
First of all, being a resource in an executable file does not mean that you are an object ready for use in memory. In most cases, you still have to load this data into a Qt object, such as an image file in QImage . You will still get this delay. And if this piece of data is not unloaded into memory, it will not be faster than reading from disk directly.
The best and almost the only thing you can do is mask the delay. This is only possible if you know what resources are needed for each state of the application, and every time you change the state, you download all the data necessary for the states from which you can switch from the current state. Thus, the resources will be loaded ahead of time, and we hope before you get into a new state that requires this. The disadvantage is that you will need to track these objects, and you will have overhead for memory, since you could load data for several states, but enter only one. Potential - most of the download can be hidden from the user, and you only preload a subset of all the data, not all the data. Naturally, reducing the amount of resources as much as possible is mandatory.
Other than this, you cannot do much. If your storage is slow, the best solution is to upgrade it, if you can, and secondly, be realistic about what you can expect from the hardware.
dtech
source share