Author Topic: Game startup time  (Read 9671 times)

0 Members and 1 Guest are viewing this topic.

Offline delta224

  • Dev Team
  • *****
  • Posts: 577
Re: Game startup time
« Reply #15 on: November 24, 2009, 04:53:31 PM »
As long as I've played this with girl packs, yes it did.
 
[Code talk]
 
 Why it was loading all the images into memory was because when you call open on a fstream object or pass it a file name for the constructor, the file is loaded into memory if it exist so that it can be worked on in memory.  Since working with memory is faster than working with the hard drive, it makes since to just load the data into memory if it exist, and work with the data in memory instead of having to constantly read and write data to and from the disk.
 
[/Code talk]
 
Sorry, it is just a pet peeve of mine that sometimes coders don't think about the side effects of what they are writing in terms of the code itself and the preformance of the code.

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Game startup time
« Reply #16 on: November 24, 2009, 05:09:41 PM »
Should only buffer the first 1k? 4K? I don't know what the default buffer size is for fstream these days. Although that's still a lot more expensive than just stat()ing the file and storing the file size and path. 

I've been looking at the image loading code in cGirls, getting in a knot over all those linked lists. Maybe I'll have a go at the loading code as well. I#m halfway there already

Offline delta224

  • Dev Team
  • *****
  • Posts: 577
Re: Game startup time
« Reply #17 on: November 24, 2009, 06:07:53 PM »
Eh, it still needs to load part of it.  Don't worry about the loading code too much.  It should use the file list class now.  I should have commented out the old code for future looking at, though.

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Game startup time
« Reply #18 on: November 24, 2009, 06:12:04 PM »
Good enough for me :)