On Mon, Mar 05, 2001 at 11:29:13AM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
> 
> Lars> Yes, I see the same here. So we have to decide if this is a slow
> Lars> down that we can live with. (on the cell phone the numbers above
> Lars> came out as 218 and 27 and I got really worried...)
> 
> Where does the slowdown come from? The ShareContainer::get method?
> Concerning this ShareContainer template, an obvious question: isn't
> there a better container than vector for this kind of stuff (a map?).
> Or could we order the contents of the container so that the most
> requested items come first?

The problem is that the data in a LyXText instance is changed frequently 
(in the LyXParagraph::GetFont and LyXText::GetFont methods).
The solution is perhaps to keep the LyXFont class unchanged, but in
LyXParagraph::FontTable store a boost::shared_ptr<LyXFont>
instead of a LyXFont.

> btw. by also having language in fontbits we can save 4 bytes more for
> each LyXFont in use. This brings the size of LyXFont down from 44
> bytes to 8 bytes.

Another option (without using shared_ptr) is to change the members in
FontBits to chars (i.e. struct FontBits { char family; char series; ...})
This is a bit ugly, but at least it will give a memory reduction, without a
slowdown.

Reply via email to