Replace fseek with putl/w to reduce io flushes

ase_file_write_start_chunk needs to skip forward the size of the chunk header, as these values will be written in later.  Using fseek was causing performance issues on my Windows machine due to causing an io flush on every chunk, for projects with many (thousands) of chunks.  Replacing with the equivalent put commands in ase_file_write_close_chunk results in ~100x speedup.
This commit is contained in:
Alex Marcolina 2021-08-01 20:44:15 -07:00
parent fc79146c56
commit 54fddf7cc3

View File

@ -526,7 +526,8 @@ static void ase_file_write_start_chunk(FILE* f, dio::AsepriteFrameHeader* frame_
chunk->type = type;
chunk->start = ftell(f);
fseek(f, chunk->start+6, SEEK_SET);
fputl(0, f);
fputw(0, f);
}
static void ase_file_write_close_chunk(FILE* f, dio::AsepriteChunk* chunk)