Revision 1226735

Go back to digest for 3rd April 2011

Optimization in Games

Stefan Majewsky committed changes in /trunk/KDE/kdegames/palapeli/src:

Memory usage optimizations for big puzzles.

DIGEST

1. Cleanup the unprocessed piece images after having finished loading.
2. Restrict the shadow radius to 50px maximum.

With a big test puzzle (4000x4000, 300 pieces), memory usage (for the
whole process) drops from 780 MB to 370 MB.

Optimization 1 makes 100 MB (= one set of uncompressed piece images),
optimization 2 fress about 300 MB (because the shadow size decreases
from about 300px to the new limit of 50px).

Note that loading time has not been affected by this. It's still
awfully slow if you have the visual effects enabled.

File Changes

Modified 4 files
  • /trunk/KDE/kdegames/palapeli/src
  •   /engine/piecevisuals.cpp
  •   /engine/scene.cpp
  •   /file-io/puzzle.cpp
  •   /file-io/puzzle.h
4 files changed in total