mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
AK+LibWeb: Use segmented vector to store commands in RecordingPainter
Using a vector to represent a list of painting commands results in many reallocations, especially on pages with a lot of content. This change addresses it by introducing a SegmentedVector, which allows fast appending by representing a list as a sequence of fixed-size vectors. Currently, this new data structure supports only the operations used in RecordingPainter, which are appending and iterating.
This commit is contained in:
parent
97f676dbf2
commit
e394971209
4 changed files with 99 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/SegmentedVector.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/AntiAliasingPainter.h>
|
||||
|
@ -623,7 +624,7 @@ private:
|
|||
PaintingCommand command;
|
||||
};
|
||||
|
||||
Vector<PaintingCommandWithScrollFrame> m_painting_commands;
|
||||
AK::SegmentedVector<PaintingCommandWithScrollFrame, 512> m_painting_commands;
|
||||
Vector<State> m_state_stack;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue