Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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