[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Frantic memory usage



On 7/21/06, David Mikesell <dave_mikesell@xxxxxxxxxxx> wrote:
No, I haven't tried that.  Do you think laptop hard drives would keep
up?

while a drive's read transfer rate can probably keep up with a game's
loading needs, it's seek times really can't (i.e. when it has to move
the drive head - basically they are good for streaming like video and
audio, not great for random access). 10ms latency on a single read
from a newer hard drive (in the last year or two) is fairly common -
if you want to get 60fps, then one single read could take up 60% of
your budget. If you are counting on actual on-demand loading from disk
for the frame you need now in your action game, you are simply begging
for choppy unpredictable frame rates. (but it's probably fine for
anything not real-time/high frame rate)

...while older drives are somewhat worse at seek times, really they
haven't improved terribly fast over the years (drive capacity &
density increase faster than the speed of the mechanics) the biggest
diferentiator with HD performance there is a full drive vs. an empty
drive (if you want to get a quick view of how slow drives can be,
browse "full stroke seek" and "latency" specs for HD's)


I have found that computers and hard drives are fast enough these days
to load the images as needed (as long as the animation doesn't run to
fast). This way you may only keep 3-4 frames at one time.

I think any OS worth using these days does a fair bit of file caching,
and that hides the performance of the hard drive a bit - with
reloading stuff you loaded a few frames ago, you are pretty much
gauranteed the OS is keeping that in cache over the long haul... so
you can often get away with reloading from "disk" because of the OS
caching... In my opinion, you won't really see how bad things are
being disk bound until you max out the physical memory in your working
set.