Thanks for the thorough investigation of the prototype.
 

> The only truly important performance metric is how long it takes 
> miniTkLeo.py to load a substantial .leo file.  I changed this file so it 
> loads my private leoPy.leo file if no file is given on the command line.
>
>
Well I think this is just one. The other maybe even more important is how 
fast tree drawing is. For example if you open in miniTkLeo  LeoPyRef.leo 
and then select the first top-level node and then press and hold left arrow 
on the keyboard it will traverse all nodes in the outline expanding if 
necessary. There is no noticeable slow down in traversing speed until it 
expands all nodes and comes to an end.

There is no such command in Leo at the present that can be connected to 
single key to compare Leo's behavior but here is a script to test it.
from leo.core.leoQt import QtCore
import datetime
def traverse_tree(t1):
    p = c.p
    def move_next():
        if p.hasChildren() and not p.isExpanded():
            p.expand()
        p.moveToThreadNext()
        if p:
            c.selectPosition(p)
            c.redraw(p)
            QtCore.QTimer.singleShot(0, move_next)
        else:
            t2 = datetime.datetime.utcnow()
            dt = t2 - t1
            t = dt.seconds + dt.microseconds / 1e6
            g.es('Finished after %fs'%t)
    move_next()
c.selectPosition(c.rootPosition())
c.contractAllHeadlines()
c.redraw()
t1 = datetime.datetime.utcnow()
traverse_tree(t1)

And I here is a similar test for miniTkLeo
def traverse_speed(x):
    import datetime
    ltm.selectedPosition = ltm.positions[1]
    ltm.expanded.clear()
    ltm.invalidate_visual()
    draw_tree(tree, ltm)
    def tf(i):
        alt_right(None)
        if i < len(ltm.positions):
            tree.after_idle(tf, i + 1)
        else:
            dt = datetime.datetime.utcnow() - t1
            t = dt.seconds + 1e-6*dt.microseconds
            G.log.insert('end -1 ch', 'Finished in %fs\n'%t)
    t1 = datetime.datetime.utcnow()
    tf(1)

G.app.bind_all('<Shift-F10>', traverse_speed)

Pressing once Shift-F10 in miniTkLeo, with the outline of 269 nodes, in 
miniTkLeo on my machine gives:

Finished in 1.067294s

Opening the same outline in Leo and executing previous script gives:
Finished after 41.404681s

Testing miiTkLeo with LeoPyRef.leo (which has more than 8000 nodes), give:
Finished in 98.063228s

I didn't dare to try it in Leo but I guess it would be huge. Just executing 
once expand-all took about 59s. Expanding one node at a time is even 
slower. So, traversing node by node, would take much more time.

For regular user I guess it is even more important to have speed tree 
browsing than to have fast read/write code which of course is also 
important.
Vitalije


-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to