mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
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:
parent
fc79146c56
commit
54fddf7cc3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user