Profiling gives almost the same result for both methods.
import timeit
def f1():
    for p1 in expandables:
        p1.isExpanded()
def f2():
    for p1 in expandables:
        ec.should_be_expanded(p1)

def tt(s, fun):
    t1 = timeit.timeit(fun, number=1000)
    g.es(f'{s} average: {t1:.3f}')
tt('using p.isExpanded', f1)
tt('using ExpandController', f2)

On my machine this gives:
using p.isExpanded average: 0.816
using ExpandController average: 0.861


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1767bbf3-f7fb-40c3-867f-bc73f081fa4bo%40googlegroups.com.

Reply via email to