Hi, I have a doubt about optimization.
Until now I dont care about load more than one time a image. So, for example, if I had two classes that need the same image I load two times instead of load one and share two pointers to the image.
But now I need to increase the speed of my games, so I have a cuestion: What is the relation between memory and fps? I can get more Fps wasting less memory, or it is only usefull when I have a limited memory space like in a mobile phone?
Thanks in advance for the help!
Often it works in the reverse, you can drastically increase you fps sometimes when you increase you memory usage. For example it is faster to store vertex normals in memory rather then generating them each frame. One way to optimize is to find a process that is repeated continuously and store the result so you only have to do it once. Or sometimes a data structure will have extra data in it that will increase memory usage but it may be faster to traverse therefore increasing fps. In the example you gave the performance should be almost identical except at load time in which case loading one image is obviously faster.