On Wed, Sep 17, 2003 at 01:16:20PM +0200, Alfredo Braunstein wrote: > Andre Poenitz wrote: > > > On Wed, Sep 17, 2003 at 12:44:06PM +0200, Alfredo Braunstein wrote: > >> Andre Poenitz wrote: > >> > >> > I think one solution which sounds expensive but probably is not at all > >> > is to get rid of the RowLists entirely and re-compute everything on > >> > demand (i.e. once per user interaction - we do something similar > >> > already). This way one paragraph can be shown in two places without > >> > problems and without having 'RowList caches'. > >> > >> I think it's feasible, but very tricky. We will have to deal with unknown > >> y positions? If you are only rebreaking what it's shown, then the y > >> position of on screen paragraphs would be unknown. > > > > We'd may need some size cache. This can live in the BufferView as a > > > > map<Paragraph *, Position> > > map<Inset *, Position> > > > > or similar which gets filled in the initial metrics phase and updated in > > each draw. > > > > To access something by coordinate, browse that cache. > > Seems reasonable. And it implies to have different bufferviews for different > loaded buffers, which can be done as a first step (solving the buffer > switching slowness).
Simply removing lines 459 and 460 in BufferView_pimpl helps already a bit (>>5%) The next step would be to change updateRowPositions into updateParagraphPositions and only storing y-coordinates in the Paragraph which should speed this (12%) up by a factor of 5 or so (assuming five rows/par) yielding another 9% gain or so (and moving into the per-paragraphs cache direction). Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)