This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 724
29
Android Eclipse IDE Java Linux MySQL Database
  • 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.

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic