ID:2107716
 
(See the best response by Nadrew.)
Code:
mob/proc/save()
if(src.cansave)
var/savefile/F = new("Saves/[src.ckey].sav")
src.xco=src.x
src.yco=src.y
src.zco=src.z
F << src


Problem description: The first time a player saves it causes the server to stall for a second or two and takes almost ten times as long as every other save afterwards. Is there anything I should be looking out for that causes this?

Really depends how much you're cramming into the file, initial writes have to generate the entire structure and populate it, subsequent writes will only write where needed and thus will be faster.
Is it normal for it to take that much more?
Best response
Like I said, it all depends on how much you're saving at once. If your game has a ton of stuff being saved into the file it's going to take time to put it all into the file.

You should look for things like raw icon data being saved and stuff of that nature, you can open the savefiles using ExportText() to find excessively large stuff being saved.

In my experience, if your savefile is over 1MB you're doing something wrong.
thnx ill take a look, my savefiles r 100-500kb
holy saving icons sure makes a lot of gibberish
In response to Zagros5000
Zagros5000 wrote:
holy saving icons sure makes a lot of gibberish

That "gibberish" is base64, commonly used to turn Binary data (such as icons) into text
gibberish to me