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
Notes:
sideshowbarker
2024-07-18 02:47:59 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/44bedf7844 Pull-request: https://github.com/SerenityOS/serenity/pull/19915 Reviewed-by: https://github.com/timschumi ✅ Reviewed-by: https://github.com/trflynn89
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
Reference in a new issue