On Wednesday, October 3, 2012 4:46:29 PM UTC-5, Edward K. Ream wrote
> Rev 5482 contains major improvements to the color caching scheme. Please test it and report any problems immediately.
A note about performance. The code that saves and restores formatting data is quite fast; they take about a tenth of the time it actually takes to redraw the body text of a node. Alas, this does not speed up node selection as much as I had hoped.
Indeed, even if restoring the syntax coloring data took *no* time it would still be fairly expensive to redraw all the text of a large node. As most of you no doubt know, rendering text is a fantastically complicated affair. The Qt rendering code is written in C++, but even that code takes more time than we would like.
As Ville and I have both pointed out, selecting a large node is similar to loading a file in a vim or emacs buffer. Users don't notice the slight delay in colorizing those buffers because the initial (slow) colorizing happens only once. So it would be if you only stayed in a single node with Leo. When inserting or deleting lines or characters, Qt (or vim or emacs) can blit bits around in the video buffers, so such operations are quite fast. But there is simply no alternative to loading the buffers initially.
One last thing. At present, color caching speeds up Leo when you move *past* a node. But when you start editing a node Leo must once again fully re-init the Qt colorizer, which takes time. So typing the first character *must* be slow, but after that typing will be fast again.
Edward