[scribus-dev] tables gsoc: primitive code review
Andreas Vox
andreas.vox at googlemail.com
Fri Jul 15 17:51:44 UTC 2011
> -----Ursprüngliche Nachricht-----
> Von: Nick Shaforostoff [mailto:shafff at ukr.net]
> Gesendet: Freitag, 15. Juli 2011 18:04
> An: Elvis Stansvik
> Cc: Scribus Development Mailing List
> Betreff: [scribus-dev] tables gsoc: primitive code review
>
> ok, in pageitem_table.h i suggest changing these kind of lines:
> /// Vertical positions of rows.
> QList<qreal> m_rowPositions;
> /// Height of rows.
> QList<qreal> m_rowHeights;
>
> into
> struct RowPosHeight
> {
> qreal position, height
> };
> QList<RowPosHeight> m_rowPosHeights;
>
>
> this would reduce memory overhead and also will make code a bit faster,
> as those two vars are often accessed/modified together.
Not necessarily. IIRC QList<qreal> will be an array of doubles, whereas
QList<RowPosHeight> will be an array of pointers to heap-allocated
RowPosHeight objects.
And it's way to early to worry about cache-optimization.
/Andreas
More information about the scribus-dev
mailing list