WindowResizer icon indicating copy to clipboard operation
WindowResizer copied to clipboard

Optimization: SaveAll writes config as many times as there are open windows

Open avengerx opened this issue 8 months ago • 0 comments

The SaveAll feature calls Save() every time for each window it locates. So if there's 25 windows to be saved, the app will call File.WriteAllBytes() 25 times, instead of building up the config file in memory (as it already does) and saving only once all is ready.

  • TrayContext.cs:396 - TrayContext.SaveAll() function, calling:
  • WindowUtils.cs:103 - WindowUtils.UpdateOrSaveWindowSize() function, that calls:
  • WindowUtils.cs:276 - WindowUtils.UpdateOrSaveConfig() function, calling:
  • ConfigFactory.cs:67 - ConfigFactory.Save() shamelessly calling File.WriteAllBytes().

avengerx avatar Mar 28 '25 10:03 avengerx