mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
AK: Don't reuse chunks in AllocatingMemoryStream
As confusing as it may sound, reusing them is terrible performance wise. When profiling the PNG decoder, the result (which is dominated by the Zlib decompression) shows that the `cleanup_unused_chunks()` function represented 14.26% of the profile before this patch and only 7.7% afterward. On a 6.5 MB PNG image, it reduces the decompression time by more than 5%.
This commit is contained in:
parent
d2637d54e5
commit
44bedf7844
1 changed files with 0 additions and 2 deletions
|
@ -277,8 +277,6 @@ void AllocatingMemoryStream::cleanup_unused_chunks()
|
|||
auto buffer = m_chunks.take_first();
|
||||
m_read_offset -= CHUNK_SIZE;
|
||||
m_write_offset -= CHUNK_SIZE;
|
||||
|
||||
m_chunks.append(move(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue