kicad-developers team mailing list archive
Mailing list archive
Re: Strokefont change from std::deque to std::vector
On 12/2/19 3:45 PM, Jeff Young wrote:
What was the reason for the change from std::deque to std::vector?
Building the stroke font is now accounting for 50% of document load
time (I /think/ because we’re using a 2D vector so that any resize of
any constituent vector has to reallocate the whole shebang).
We also load the font twice, which is something I’ll look at fixing
irrespective of the above.
Hmm... That's true. As we are allocating, we don't have pre-knowledge
of the Hershey point list lengths, so the vectors get resized as we
add. How much will depend a bit on implementation. But we'll gain speed
by cycling once over the font and building our length knowledge first.
The vector change was due to the deque overhead. A deque takes a fair
amount of memory for the structure. We generate a bunch of vectors with
only 3-4 elements and the size of the deque is dominated by the
structure overhead. There was so much that JP's machine was crashing
with the extra CJK fonts.
KiCad Services Corporation KiCad Services Corporation Logo
www.kipro-pcb.com <https://www.kipro-pcb.com/> info@xxxxxxxxxxxxx