I'm creating a Ruby game using the Gosu framework. All good.

Sometimes, when I run the game, it has some kind of slow startup, and probably it will be rather slow during the whole game. So I close it and... open it again. It is very likely that it will startup quickly and the whole game will run smoothly and fast.

Why is that? What is this phenomenon? Is it faster because of some cache stored or whatever since the first run? (But why would cache be stored? If the app dies, I would expect no references at all etc...)

Ruby, Windows 7.


Windows will wait until that memory is needed for something else before paging out your game's files. But when it does, they will have to be reloaded from the hard drive, which is le expensive.

| improve this answer | |
  • Would the same happen in Mac OS? If not, then I can assume that no matter how many times I run the game, it will always be slow there, right? – Omega Jun 23 '12 at 21:04
  • @Omega: No idea. I'm a Windozer. But I do know that it explicitly caches frequently used files, on top of the caching behaviour I described. – DeadMG Jun 23 '12 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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