I have done some tests with the type of container used to store the
paragraph contents in LyXParagraph.
I have tried with: char*
vector<char>
deque<char>
rope<char>
I have after some testing settled on using vector. Compared to char*
we get a lot of help from useing a std::container instead of handling
all the memory allocation and insertions ourselves. Deque is very
similar to vector, but can have some better complexity when it comes
to insertion and end and beginning.
rope (the sgi::container) is the one that I had high expectations to,
but it was buggy and I have to edit the system files to make it
compile. Also it did not should a huge improvement.
For testing I made myself a test.lyx with a _HUGE_ single paragraph.
(tens of pages). The char* version used 3! minuets to load this... the
stl containers used less than 10 secs. The only place where I noticed
that rope had any advantage was when testing copy/paste in this huge
paragraph.
Since paragraphs are not usually very long vector seem to be a good
choice. (deque could also be used but it often gives some annoying
compilation warnings.) The old char* method is not flexsible enough...
When the code in cvs has been tested engough I will remove all support
for using char* and text container.
One other thing: standard containers are assignable, and that is often
a nice property.
Memory: the footprint of vector is a bit larger than char*, but not
by much, if think it is about 500k or something.
Lgb