aspose file tools*
The moose likes I/O and Streams and the fly likes Extremely slow I/O when loading game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Extremely slow I/O when loading game" Watch "Extremely slow I/O when loading game" New topic
Author

Extremely slow I/O when loading game

Paul Mrozik
Ranch Hand

Joined: Feb 10, 2013
Posts: 117

I'm working on a simple game and when the game starts it preloads the following:

1. A serialized object containing a HashMap, about 8MB in size
2. About 260 png files, each one about 10-15k in size

I am running this on a 1.25Ghz G4 PowerBook and OpenJDK7 (interpreted mode) so I realize it's not going to be super fast, but it takes about three minutes before the main box appears.

I read somewhere that what I could do is put those png files into one big png file and then just chew off a part of it when necessary, and I did read that this made a substantial difference. As for the HashMap, it's basically a word dictionary. Once loaded it's quite fast, but it still takes way too long to load.

What can I do to improve performance? I should have a much faster PC (AMD Athlon X2 64 ) up and running within the next two weeks, but I will probably still need to optimize the loading.

Thanks in advance.
Ron McLeod
Ranch Hand

Joined: Feb 12, 2013
Posts: 329
    
    6

Where are the image files loaded from - local file system, network server?

Do you need to load all the images at start-up, or can you lazily load them as required?
Paul Mrozik
Ranch Hand

Joined: Feb 10, 2013
Posts: 117

Ron McLeod wrote:Where are the image files loaded from - local file system, network server?

Do you need to load all the images at start-up, or can you lazily load them as required?


The images are loaded locally.

I probably could load after the user starts a new game. Each image is a letter and I think it would take about a second to each word.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Extremely slow I/O when loading game