Lag during autosave
Lag during autosave
Is there any way to reduce lag during autosave? Any ideas?
Re: Lag during autosave
<sarcasmon>Save in an Ramdisk.<sarcasmoff>
Re: Lag during autosave
I'm already saving to ramdisk. It's not helping.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: Lag during autosave
You could always turn off autosave and just save when you feel it's necessary.
Re: Lag during autosave
Unfortunately, I usually think it is necessary to save just after I needed toFishSandwich wrote:You could always turn off autosave and just save when you feel it's necessary.
Re: Lag during autosave
Autosave saved my work a lot of times. I guess i'll have to get better at planning
Re: Lag during autosave
Ah, so it's autosave. I already wondered what freezes my game every few minutes. I already play the game on a SSD, so I don't want to know how long it'd take to save to an hdd.
Re: Lag during autosave
You know you can change the interval between the autosaves in options, right?
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: Lag during autosave
I play it on a HDD and the freeze ups take a fraction of a second. The files are tiny most of the time(less than 20mb) so I don't think it's anything to do with whether it's HDD or SSD but the compression process(since it zips the file) that slows it down. Most likely the game is waiting for the compression process to finish before it can continue.NicoH wrote:Ah, so it's autosave. I already wondered what freezes my game every few minutes. I already play the game on a SSD, so I don't want to know how long it'd take to save to an hdd.
I remember a dev saying a while ago that they were going to put the autosave process on another thread so that autosaving was more seamless. I guess we'll just have to wait for that.
Re: Lag during autosave
Saves are worse as your map is getting bigger. I start with 2 min, when i explore more and more i increase autosave interval to 4 - 5 - 10 - 20 - 30mins, because it gets only worse.
-
- Filter Inserter
- Posts: 559
- Joined: Mon Mar 04, 2013 9:23 am
- Contact:
Re: Lag during autosave
I don't think that the main reason why it takes so much time for saving game are the HDD or SSD speeds. I belive that the main reason for this is the way how Factorio currently handles ingame data.
When you have a static sized map you usually store all the map data in one data block so saving that data into savegame only requires one call "save that data block into a file".
But when you have practically infinite map split into multiple chinks then each of those chuks is saved into its own data blocks. So when you are saving such map into savegame you must call "save that data block into a file" so many times as you have the number of map chunks. And this slows down the process considerably especially if you are writing these data blocks directly into a savegame file.
That is a bit similar as copying bunch of small files versus one large file even thou combined size of those small files is same as the size of large file. Of course Factorio doesen't open and close the file handle for each block (this is pretty slow process) but still this is loswer that it would be if the whole savegame file was composed in the memory and then written as a whole. Why?
When you are writing small block of data into sime file you might not be making full use of HDD's or SSD's chache but when you are writing bug blocks of data into a file the HDD's or SSD's chahce is fully utilized.
So based on everything that I wrote it would be best if Factorio would compose entire savegame inside the memory first and then write it on the HDD or SSD in seperate thread. But the problem with this is that in order for you to be able to fully compose the savegame inside the memory you first need to have enough memory available. ANd this could cause Factorio not to work any more on some low end computers becouse its memory requirements would increase. Also you need to have a falback mechanizm which would be used when the game doesen't have nough memory for building whole savegame inside the computers memory. And this presents the problem that due to the Factorio map to be of dynamic size you practically can't know for sure how much memory would you require.
When you have a static sized map you usually store all the map data in one data block so saving that data into savegame only requires one call "save that data block into a file".
But when you have practically infinite map split into multiple chinks then each of those chuks is saved into its own data blocks. So when you are saving such map into savegame you must call "save that data block into a file" so many times as you have the number of map chunks. And this slows down the process considerably especially if you are writing these data blocks directly into a savegame file.
That is a bit similar as copying bunch of small files versus one large file even thou combined size of those small files is same as the size of large file. Of course Factorio doesen't open and close the file handle for each block (this is pretty slow process) but still this is loswer that it would be if the whole savegame file was composed in the memory and then written as a whole. Why?
When you are writing small block of data into sime file you might not be making full use of HDD's or SSD's chache but when you are writing bug blocks of data into a file the HDD's or SSD's chahce is fully utilized.
So based on everything that I wrote it would be best if Factorio would compose entire savegame inside the memory first and then write it on the HDD or SSD in seperate thread. But the problem with this is that in order for you to be able to fully compose the savegame inside the memory you first need to have enough memory available. ANd this could cause Factorio not to work any more on some low end computers becouse its memory requirements would increase. Also you need to have a falback mechanizm which would be used when the game doesen't have nough memory for building whole savegame inside the computers memory. And this presents the problem that due to the Factorio map to be of dynamic size you practically can't know for sure how much memory would you require.
Re: Lag during autosave
Maybe put option to use experimental save feature? Provided there will be some crazy fast mechanic to save without even a slightest lag. I have lot of ram so no problem.