Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extremely slow I/O when loading game

 
Paul Mrozik
Ranch Hand
Posts: 117
Chrome Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 963
59
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 117
Chrome Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic