Author Topic: Massive Lag on Screenshot  (Read 732 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Massive Lag on Screenshot
« on: 27 September 2010, 22:15:45 »
When taking a screenshot (default: 'e' key) on GAE 0.3, the game freezes for several seconds before resuming. It did not do this before, and usually was a very fast instant picture. The freezing, abet, temporary, interupts gameplay for several seconds.

No known ideas for cause, though it seemed to appear with every screenshot, regardless of where or the map used. (default 1024x768 resolution).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Massive Lag on Screenshot
« Reply #1 on: 28 September 2010, 11:37:27 »
Looks like silnarm fixed it in revision 819, 0.3.1.

fix ultra slow screenshot capture on windoze

The fix is to store the pixels in a buffer then write them to the file in one go instead of writing to the file for every component (RGB) of every pixel. Disk IO is one of the slower activities to do so having it try to access the file that many times (1024x768x3 = 2359296) would be slow.
« Last Edit: 28 September 2010, 11:39:22 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Yggdrasil

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: Massive Lag on Screenshot
« Reply #2 on: 28 September 2010, 17:05:40 »
Physfs causes this as it adds some overhead to every io operation. As hailstone said there are really many of them.

 

anything